Method 1. The following procedure executes the Opentheindexpage () method when the page is fully loaded
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title>telecommunications Data Collection system</title>
<script type= "Text/javascript" src= "<%=contextpath%>/js/baseframe.js" ></script>
<script type= "Text/javascript" src= "<%=contextpath%>/js/cookies.js" ></script>
<script type= "Text/javascript" src= "<%=contextpath%>/js/tag/tag.js" ></script>
<script language= "javascript" for= "window" event= "onload" >
function Opentheindexpage () {
Openmyuriwithcid (True, ' root ', ' IDX ', ' iframe/dispatch.jsp?url=tdc/zhk/impctrlobjinf/index/index.jsp ', ' home ',
' Top.tagmenu ', ' top.maintop ', true,
' System/accesspaths.do?currentmodulecode=idx ',
' MainMenu ', true);
};
if (document.readystate== "complete") {
Opentheindexpage ();
}
</script>
<body>
</body>
Method 2: Can be the following, but the effect is not as good as Method 1.
<body onload= "function name ()" > </body >
<script>window.onload=function name </script>
<script language= "javascript" for= "window" event= "onload" >function name (); </script>
The second one can only write a function, and can not give variables, the most useful is the last one, you can write independently, how the writing is OK.
Method 3:<body onload= "xxx ()" > </body> xxx () for the function you want to perform
Method 4: Add defer to the script tag
namely <script defer= "defer" language= "JavaScript" >
or <script defer language= "JavaScript" >
Run the script after the entire page has been loaded. (No effect)
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.