utzel Posted March 7, 2006 Share Posted March 7, 2006 Hi there!The Site has 2 frames. In frame one there is a select tag in a form. The onload-event of the body tag selects the first entry and submits the form target second frame. works fine ... sometimes. but often I get an javascript error and it seems that the onload event is fired before the document is completly loaded. Is it possible to ensure that the document is completly loaded?Thanx and sorry for my bad english?utzel Link to comment Share on other sites More sharing options...
scott100 Posted March 7, 2006 Share Posted March 7, 2006 I can think of 2 possible ways: <body onload='window.setTimeout("myFunction()",2000)'> That will call the function 2 seconds after the body loads, you could change it to whatever seconds you like.or you could put the function call at the very bottom of the body of the page. <body><p>Put all my HTML first</p><script>myFunction();</script></body> Link to comment Share on other sites More sharing options...
utzel Posted March 8, 2006 Author Share Posted March 8, 2006 Can you tell me, when exactly the event onload will be fired?I thought that the document must be completely loaded ... Link to comment Share on other sites More sharing options...
scott100 Posted March 8, 2006 Share Posted March 8, 2006 me to http://www.w3schools.com/jsref/jsref_onload.asp Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now