Hi, I execute the following code and just get a blank (black) window. The window caption shows but I have not yet gotten the images to load. Please help. (I tried using other images than the ones utilized too). the .py and the images are in the same directory.

I am using an ActiveX which is refered using <object> tag in my JavaScript code. This javascript is used in a Java based web application. When user browse this page first time, my ActiveX get downloaded from server and installed on client machine. I want to show a progress bar when IE downloading ActiveX. Please suggest what apporach I can use to implement this.

The unfortunate thing is that you can't do a true progress bar, because you don't have access to the count of downloaded bytes. What most sites do is to display an animated gif image that acts as a placebo. It makes people feel like something is happening, but gives no true measure of it.

vState Variant that receives one of the following values.uninitialized Object is not initialized with data. loading Object is loading its data. loaded Object has finished loading its data.interactive User can interact with the object even though it is not fully loaded. complete Object is completely initialized.

The property is read-only. The property has no default value.

Remarks

The states through which an object passes are determined by that object; an object can skip certain states (for example, interactive) if those states do not apply to that object.

nState Integer that receives one of the following values.0 The object has been created, but not initialized (the open method has not been called). 1 The object has been created, but the send method has not been called. 2 The send method has been called, but the status and headers are not yet available. 3 Some data has been received. Calling the responseBody and responseText properties at this state to obtain partial results will return an error, because status and response headers are not fully available. 4 All the data has been received, and the complete data is available.

If you right-click a table-row with Chrome or Opera, you can then select Inspect Element.This will open the Dev Tools console. with the table-row still selected, you can then open the Event Listeners entry in the accordian. When I did this, I saw that the code for handling mouse-clicks on table-rows was to be found on line 522 of functions.js

With that done, one can see that the function basically looks for all any child elements of the row of type 'input' it then does some logic checking before checking/unchecking the checkbox.

Here's the function for reference. (I've marked what was line 522 with *****)

Well, you can't do it with PHP. That is to say, PHP is only good for performing calculations before outputting to a web-browser.

You can't do it with the keyboard, since the keyboard just allows you to create the page that is then displayed. Well, for the purpose of this discussion, PHP works just like the keyboard, except a little faster.

So, where does that leave you if you want to create a page with PHP and have it behave in the same way?

Well, you simply put the appropriate javascript into a js file. You then link that file to the html output, with a <script src='......'></script> tag.

You can see from the last line of the code I posted, that the onload function for the document calls a function which attaches an event handler to each of the table-rows in the page.

So, you could put the function into the javascript file.You can link that file to the output of the PHPYou can call the function either with <body onload='yourInitFunc();'> in the html or with window.onload = yourInitFunc; in the javascript.

Presumably, you're assembling the page in PHP perl-style, I.e you're using print, printf or echo to output each line of content as you go. In that case, you just output the required tags with a print statement at the appropriate place.

If on the other hand, you're using DOM objects to construct the page - then you'll need to create the script node & set it's src attribute to point to the javascript file.

To be perfectly honest, if I was in your shoes then I'd just make a quick html file that did nothing but try to attach a function to the onclick event of each of the table rows. Okay, I got bored - have a play around with this. Make it work the way you'd like, then output the file dynamically, instead of with the keyboard (or in your case, copy/paste)

<!doctypehtml><html><head><script>function myRowClickFunction()
{
alert('row clicked');
}
function myBtnClicked()
{
alert('btn clicked');
}
function addBtnToRow()
{
// *** 'this' points to the row that was clicked ***
// make a new table-cell element
td = document.createElement('td');
// make a new input element
btnInput = document.createElement('input');
btnInput.setAttribute('value', 'click me');
btnInput.setAttribute('type', 'button');
btnInput.onclick = myBtnClicked;
// place the btn inside the new table cell
td.appendChild(btnInput);
// place this new cell inside the row that was clicked
this.appendChild(td);
// remove the onclick handler from the row, to prevent adding a button multiple times
this.onclick = null;
}
// attach the specified function to the onclick event of all 'tr' elements in the document
function attachEventHandlerToTableRows(functionToAttach)
{
var i, num;
var tableRows = document.getElementsByTagName('tr');
num = tableRows.length;
for (i=0; i<num; i++)
{
tableRows[i].onclick = functionToAttach;
}
}
// Sample onInit function.
// make sure you only use one functionor the other here
function myInit()
{
// the row will just tell us that we've clicked it
attachEventHandlerToTableRows(myRowClickFunction);
// the row will add a cell that contains a button, whenever the row is clicked
// try commenting out the above line of code and uncommenting this one instead
//attachEventHandlerToTableRows(addBtnToRow);
}
</script>
</head><bodyonload='myInit();'><table><tbody><tr><td>This is row 1</td></tr><tr><td>This is row 2</td></tr><tr><td>This is row 3</td></tr><tr><td>This is row 4</td></tr><tr><td>This is row 5</td></tr></tbody></table></body></html>

(I'm not sure if you can use tBodies[0].rows.indexOf or something like that. I'm not an expert in this regard. But what you usually want is actually a row id which can be tied into the query you are running, and that won't be the same as the index anyway.)

If you know the checkbox is in the same row, though, you don't need the index to adjust it.

Just like Bob said, the easiest/quickest way to get the index of the clicked row (in case you need the number for something else) is to add an attribute to the TR elements - you can then query this value in your onclick handler.

Beautiful! I can think of many places where this would be useful. Bravo on your explanation and great example! Clean, concise, and well documented. I don't usually get to do too much web development, but just spent a week immersed in it adding features to a legacy ASP application. It never fails to amaze me how much can be handled on the clent side. I think you might only be limited by your imagination.

Hi, I want to make ref of jquery.js through c# code and then want to create a function in C# to which i want to pass object as parameter. That function will do tasks that JQuery do. f.g Button as object and do animations on button using Jquery with C#(function). Thanks in advance.

Hi, I am an intermediate user with JQuery. Actually I want to create a class in c# that will handle Jquery functionality.My purpose regarding this is :1> If someone dont know jquery then one can use my C# funtions for animation or other tasks that jquery has. My class will call jquery functions and ll return output.2> Easy to debug the code using vs-degugger.

I write server control dll's, in which I embed scripts, and load the appropriate ones on demand, during the page.init life cycle. And then I create controls, that wire up to the scripts. When the page loads, everything is functional.

If you just had a pin-point question, with a code sample, then that's easy to answer, but in your case, your looking for someone to engineer it for you, and I don't think a class is sufficient for your needs.

I don't have an answer to offer, because I think the concept is flawed, or it exist on a super advanced level of programming.

I don't think you understand how ASP.net works. This isn't entirely your fault because ASP.net does its best to hide the client/server nature of websites.

Back end (C#) code is executed on the server. Its purpose is to generate markup which is sent to the browser, which can include scripts and links to scripts (e.g. jQuery). Once a request has been handled and markup sent back to the browser, your back end code is not running any more.

jQuery (like other JavaScript code) is run in the browser, and allows you to modify what the client sees or does. Anything interactive that happens in the browser is done with JS.

The only ways to communicate between them are HTTP requests, either through loading a new page with an <a> or <form action=...> tag, or via an AJAX request.

Animation is a client side task and therefore it will always be done with JavaScript. There is simply no (sane) way to get back end code involved in that code cycle, because the animation is done in the browser and the server is not involved.

First you find one that fits your purposes, then you download it and add any components/JavaScript references/CSS files that it needs. Finally, you add it to your page and call any initialisation routines.

That's as specific as I can get right now. The editor you include should have samples and documentation that show how to add it into your site.

here is my issue , I would like to be able to set a checkbox named mycheckbox to yes by inserting a script in an external webpage.let's say i want this check box to be check when i execute the code in the website: www.somewebsite.com

I wrote this, and after changing the value of the dropdown like 20 times, I noticed the function got slower and slower until I was not able to select a value after about 6 times. I tried optimizing it, it was 3 times, now 6.

Not quite sure where I dropped the ball at here, or what is consuming large amounts or resources.

So instead of going back to the server to get fresh values, I just took them from the html in the option list of the dropdownlist, and parsed out the values I wanted.

I thought of this last night while bowling, and it worked. I'm kind of surprised it works, but it makes sense. I just had to get into the array object before using $(each). Must be that double $(each) I was thinking of yesterday, in which the first $(each) is the array, and the 2nd $(each) is the pair value.

As you are trying to create the date from a specific string, you should realise that the problem is actually at the point that you parse the date. Basically the to indexes in your substrings are out by one.

I have excel which contains time in Column A and Name in Coulmn B.I have javscript which reads systems current time and display what are the next 5 times in my excel from current time.For Ex: now time is 10:30(system time), it displays 11:00, 11:20,12:00, 12:10, 1:00 like that

Now my question is: with these values, it should also display previous 5 times from my excel.

For Ex: Output should be like thisCurrent time: 10:308:008:409:009:3010:0011:0011:2012:0012:101:00

Hi All, Have a code which sends an Outlook mail using Javascript by creating an instance of ActiveX object. I need the functionality to be such, when the user executes this code his default signature should also be added in the mail...Have tried it but to no avail..Any help would be highly appreciated... The code goes as follows for the reference: