[Javascript] Sleep, or something else...

Peter Lauri lists at dwsasia.com
Fri Aug 18 14:49:45 CDT 2006


I have this:

 

if(!document.getElementById('msgsubject')) showCompose();

 

document.getElementById('msgto').value =
document.getElementById('msgto').value + toid + ";";

document.getElementById('msgtoname').innerHTML =
document.getElementById('msgtoname').innerHTML + toname + "; ";

 

 

 

The showCompose() creates element with id msgto and msgtoname. However, it
is not recorded. However, if I put an alert() in between it detects it. This
makes me believe that it is actually going a little bit too fast for my
script, so that the msgto and msgtoname does not have time to be created, so
they can not be found (error in script). The alert() seam to give the script
enough time for the elements to be created, and it works, hrm :)

 

Anyone with insights?

 

/Peter

 

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20060819/eb611f9e/attachment.htm>


More information about the Javascript mailing list