Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running Javascript Immediately After Loading

Status
Not open for further replies.

dakota81

Technical User
May 15, 2001
1,691
US
Due to web-browser quirks, I've run into a small design dilema and am wondering if anyone has any clever ideas. What I want is once the document is completely loaded, html & images, I want the screen to refresh once. It is quite easy to simply call the windows.history.go(0) function, but it ends up refreshing indefinately. Could a cookie work to save a variable? I have very limited Javascript knowledge, so I'm not sure myself what can be done.
 
-> you should have asked this question in the javascript forum where you'd have get a faster or more accurate answer ;-)
-> still ... you can catch the event "onload" (in the body tag), that fires when the page is loaded :
<body onload=&quot;javascript:some_function()&quot;>
-> now to reload a page, the javascript function is reload() [reload(true) will force the reload]
-> so now you can write :
<body onload=&quot;javascript:window.location.reload()&quot;>
[if you use reload(true) your page will refresh indefinately]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top