[Javascript] Sleep, or something else...
João Cândido de Souza Neto
joao at curitibaonline.com.br
Fri Aug 18 15:39:47 CDT 2006
Help is the main meaning.
João Cândido de Souza Neto
Curitiba Online
joao at curitibaonline.com.br
(41) 3324-2294 (41) 9985-6894
http://www.curitibaonline.com.br
----- Original Message -----
From: Peter Lauri
To: '[JavaScript List]'
Sent: Friday, August 18, 2006 5:27 PM
Subject: RE: [Javascript] Sleep, or something else...
This did help, but I changed it to, thanks.
function msgAddTo(toid, toname) {
if(!document.getElementById('msgsubject')) showCompose();
setTimeout("msgAddToFields("+toid+", '"+toname+"');", 100);
msgCheckSendForm();
}
function msgAddToFields(toid, toname) {
document.getElementById('msgto').value = document.getElementById('msgto').value + toid + "; ";
document.getElementById('msgtoname').innerHTML = document.getElementById('msgtoname').innerHTML + toname + "; ";
}
/Peter
------------------------------------------------------------------------------
From: javascript-bounces at LaTech.edu [mailto:javascript-bounces at LaTech.edu] On Behalf Of João Cândido de Souza Neto
Sent: Saturday, August 19, 2006 3:01 AM
To: [JavaScript List]
Subject: Re: [Javascript] Sleep, or something else...
Try to do this:
if(!document.getElementById('msgsubject')) showCompose();
setTimeout("
document.getElementById('msgto').value = document.getElementById('msgto').value + toid + ";";
document.getElementById('msgtoname').innerHTML = document.getElementById('msgtoname').innerHTML + toname + "; ";
",500);
It would make a sllep until the objects has been created.
If needed, you ought to increase the time of setTimeout.
Hope help.
João Cândido de Souza Neto
Curitiba Online
joao at curitibaonline.com.br
(41) 3324-2294 (41) 9985-6894
http://www.curitibaonline.com.br
----- Original Message -----
From: Peter Lauri
To: '[JavaScript List]'
Sent: Friday, August 18, 2006 4:49 PM
Subject: [Javascript] Sleep, or something else...
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
----------------------------------------------------------------------------
_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript
------------------------------------------------------------------------------
_______________________________________________
Javascript mailing list
Javascript at LaTech.edu
https://lists.LaTech.edu/mailman/listinfo/javascript
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20060818/2651c482/attachment.htm>
More information about the Javascript
mailing list