Question:
Can you pause a script in javascript until a page is loaded?
2010-08-23 19:52:46 UTC
Hi. I am trying to create a script in javascript that opens up a new window and then proceeds to manipulate it. However, it will only really work if the window is fully loaded before the script proceeds to run. Can anyone give me the full code to create a new window (something similar to "var newWindow=window.open(...)") and then pause the script until the window is fully loaded?
Three answers:
Ratchetr
2010-08-23 20:22:09 UTC
So, the window you are trying to manipulate is coming from a different web site (domain?).



If so, then no...you can't do much of anything to manipulate that window. For security reasons, javascript on site A.com can't manipulate a page from B.com, even if A.com opened the window from B.com.



See item 9 in the FAQ here:
moncayo
2016-10-26 10:46:15 UTC
positive u can initiate a function without onload. After declaring the function interior the script tag call the function. If u should not manage to have a good time with what i discussed see the trend software i gave less than --------------------------------------.....







The Javascript won't run until it gets to the end of the body, by which time the whole page is loaded.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...