Jump to content

Frames and Timing Problem


utzel

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...