English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have the following script:

function LoadMainAndMessage(MainURL, MyMessage) {
  if (MainURL) {
    parent.frames['main'].location=MainURL;
  }
  if (MyMessage) {
    alert(MyMessage);
  }
}

which is triggered with a body onload command. Whenever I pass it something, it always does the ALERT first! How can I get it to display the alert AFTER the page has loaded (or at lease started loading?)

ie: I send LoadMainAndMessage("http://www.yahoo.com","Page Loading") and I'd like it to :

1) Load page http://www.yahoo.com in the "Main" frame, THEN
2) Display "Page Loading" as an alert (once the page HAS started loading!)
3) Require the user to click OK or CLOSE on the alert box

Instead, what it does now is:

1) Display "Page Loading"
2) Wait for the user to click OK or CLOSE on the alert box
THEN
3) Starts loading http://www.yahoo.com into the MAIN frame.

HELP! PLEASE! and Thanks!

2007-06-04 22:21:42 · 3 answers · asked by Mike Z 5 in Computers & Internet Programming & Design

3 answers

Use the onreadystatechange event to see if the page is loaded.

Ex.

2007-06-04 22:48:09 · answer #1 · answered by Riekkie 2 · 0 0

they are surprising which you will die, yet you will in basic terms might desire to attend longer to do it than people who consume undesirable. heavily meat has been linked to increasing your threat of maximum cancers. international places the place they do no longer consume pork additionally do no longer even have colon maximum cancers. ailments like crohn's and ulcerative colitis are ailments of the fashionable international the place we've those terrible diets of processed ingredients. Underdeveloped international places the place they actual in basic terms consume what they strengthen don't have those ailments. I even have those days been engaged on reducing out meat and different processed ingredients because of the fact of wellness themes and that i've got been feeling greater conventional than I did for the final numerous years. i do no longer understand what the situation could be as long as you pay interest to get sufficient of each and every nutrient, yet you may desire to try this in case you consume meat to. it is not like meat is a few ask your self foodstuff that provides each and every thing you prefer. there are numerous plant life and such that furnish lots of protein, and too lots protein is a sickness besides. i individually experience greater energetic after a fruit and vegetable wealthy meal than a customary one.

2016-11-04 23:55:00 · answer #2 · answered by Anonymous · 0 0

Add a delay, say 5 seconds, the page should have loaded by then, if you use firefox ;)

2007-06-04 22:26:53 · answer #3 · answered by Anonymous · 0 0

fedest.com, questions and answers