This article is mainly on the JavaScript page automatically loading events are introduced, the need for friends can come to the reference, I hope to help you.
Method 1: The code is as follows: window.onload=function () { var Name=document.getelementbyid ("name"). Val ();//Load HTML, and load external all references (pictures, CSS styles, JS, etc.)} Method 2: the. js file that needs to be introduced into jquery code is as follows: $ (document). Ready (function () { & nbsp alert ("first entry case for jquery");//load HTML, do not wait, load immediately}); Method 3: (equivalent to Method 2) The code is as follows: JQuery (function () { if ($ ("input[name= ' message ')"). Val ()!= "")   ; alert ($ ("input[name= ' message ')"). attr ("value")); }); Method 4: (equivalent to above) the code is as follows: $ (function () { alert ("Execute 1 when JQuery page is loaded automatically ..."); }); Method 5-1:window.onload Event loading (loading multiple functions at the same time when the page loads ...) code as follows: <html> <body onload= "function1 () , function2 (), Function3 () "> </body> </html> <script > function1 () { } Function2 () {} function3 () {} </script> method 5-2:window.onload Event loading (loading multiple functions at the same time when page loads ...) The code is as follows: <html> <body> </BOdy> <html> <script> function1 () { } function2 () { } &nbs P function3 () { } window.onload=function () { function1 (); Function2 (); Function3 (); } </script>