DotNetNuke Skins and Resources by ThinkofDesign

Forums

Subject: Add onLoad event handler into the BODY tag
Prev Next
You are not authorized to post a reply.

Author Messages
Vasilis User is Offline
Yellow Member
Yellow Member
Posts: 315


01/10/2007 03:49 AM  

I found this tip on the official DNN forums and I think it's good to have it here.


Posted on DNN forums by John Mitchell:

You can execute your script onLoad by adding the following cross-browser code to the top of your Javascript file:

if (window.addEventListener){
      window.addEventListener("load", Your_Function_Name, false);
}
else if (window.attachEvent){
      window.attachEvent("onload", Your_Function_Name);
}

Just replace the Your_Function_Name with the name of the function you want to execute, no quotes or parentheses.



The thread on DNN forums:

Add onLoad event handler into the BODY tag

You are not authorized to post a reply.
Forums > DotNetNuke > Tips and tricks > Add onLoad event handler into the BODY tag



ActiveForums 3.7