Method 1:The following procedure executes the Opentheindexpage () method when the page is fully loaded
Copy Code code as follows:
<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.
Copy Code code as follows:
<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)