This article mainly introduces the automatic loading of javaScript pages. If you need it, you can refer to it for help.
Method 1: the code is as follows: Window. onload = function () {Var name = document. getElementById ("name "). val (); // load HTML and all external referenced files (images, css styles, js, etc.)} Method 2: Jquery's. the js File Code is as follows: $ (document ). ready (function () {alert ("JQuery's first entry case"); // loads HTML, without waiting, load now}); 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) the code is as follows: $ (function () {alert ("when the JQuery page is automatically loaded, execute 1 .... ") ;}); Method 5-1: window. onload event loading (multiple functions are loaded at the same time during page loading ...) the Code is as follows: