Function Section
Copy codeThe Code is as follows:
<Script type = "text/javascript">
Function compute AB (){
$ ('# Container> ul'). tabs ({selected: 0 });
}
</Script>
Copy codeThe Code is as follows:
<Body>
<Div id = "container"> <! -- Dom to be loaded -->
<Ul>
<Li> <a href = "# fragment-1"> <span> fixed variable definition </span> </a> </li>
<Li> <a href = "# fragment-2"> <span> document lifecycle management </span> </a> </li>
<Li> <a href = "# fragment-3"> <span> set </span> </a> </li>
<Li> <a href = "# fragment-4"> <span> zookeeper configurations </span> </a> </li>
<Li> <a href = "# fragment-5"> <span> zookeeper management </span> </a> </li>
<Li> <a href = "# fragment-6"> <span> zookeeper </span> </a> </li>
<Li> <a href = "# fragment-7"> <span> zookeeper lifecycle management </span> </a> </li>
</Ul>
.................
</Div> <! -- Dom end to be loaded -->
<Script type = "text/javascript">
Using AB ();
</Script> // load the function in advance
<! -- The remaining large code -->
</Body>
In this way, javascript can be executed after the specified dom output is complete without waiting for the page to be fully loaded.