Click to See Complete Forum and Search --> : how to delay a javascript command


PGMR_1998
06-10-2003, 08:30 AM
is there a way to delay a javascript command until the previous command has completed?

Gollum
06-10-2003, 08:57 AM
Not quite sure what you mean here.

There are ways in JS to delay a bit of javascript until a timeout, but that doesn't sound like what you are after.

JS is single threaded, so if a 'command' is executing, nothing else will be running. Sooooo, if you want to run some code after the command has finished, then why not execute your code at the end of the previous command code?

PGMR_1998
06-10-2003, 09:09 AM
i have two commands back to back. the first command opens a new window and loads a ms word document. the second command loads a second ms word file into the same window. when i look at the second word doc, it is ok, but when i look at the first word doc, it contains all of the ms word hidden tags and commands. it seems as if the second file started loading before the first one was complete. i next tried the same code using pdf files instead of ms word files, and i got the same result. the first pdf file contained all of the adobe tags and commands that is not seen by a user.