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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

launch function on page load

Status
Not open for further replies.

bewin99

Programmer
Sep 25, 2008
15
GB
Presently the code on my site will, once the main image is clicked, check the screen resolution and then open a website depending on the one that best fits the webpage created for its dimension e.g. 1024x768, 800x600... I placed that dimension checking code into a function and then made the image a button to call it, but before I did that the code would automatically run when the user loads the page and I would like to get that back.

How do I modify the code so that the resolution check and launching of the correct website happens on page load while also performing the same action if the main image is pressed on the page as now?


Many thanks.
 
It seems to me you could call the same function under the onload event and also the image click event. Have you tried this?
 
Solved:

<BODY onLoad="dimension_test()">

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top