A page is not sent back to the server. that is, the html, javascript, and css are never sent back to the server. The data in the form is sent back.
>Do I understand that if you add an element (e.g. div of id="test") in the script section of the page, and then the page is sent back from the server (posted back) this element no longer exists? That is, I cannot use this element in the IF statement of the javascript?
>
>For example, I want to call a certain method of the page but only One Time. And I was doing the following (which does not seem to work):
>
>
> if ($('#Test').length==0) {
> // div of ID Test does not exist.
> // create this div
> var $div = $('<div />').appendTo('body');
> $div.attr('id', 'Test');
> // Call button click method.
> document.getElementById("btnTest").click();
> }
>
>
>The above seem to go into an endless loop.
>
>Any suggestions? TIA
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer