Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Understanding javascript
Message
From
08/12/2015 17:38:53
 
General information
Forum:
Javascript
Category:
JQuery
Miscellaneous
Thread ID:
01628679
Message ID:
01628680
Views:
52
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform