Methods trigger function function when the page loads

Method One:
jQuery in: $ (function () {} ) write your content in parentheses
Method two:
window.function () // use the onload event of the window, the form is loaded when
{
// do something
}
Method three :
. $ () READY (function () {
Alert ( "AAA");
});

Published 35 original articles · won praise 2 · Views 1374

Guess you like

Origin blog.csdn.net/weixin_41001497/article/details/104035002