Home > Web Front-end > JS Tutorial > body text

Several ways to execute Jquery after the page is loaded_jquery

WBOY
Release: 2016-05-16 16:55:29
Original
822 people have browsed it

Method 1:

Copy code The code is as follows:

$(function(){

initPublish();

});

Explanation: initPublish() is the JS function you want to run; this code is placed at the bottom of the page.

Method 2:
Copy code The code is as follows:

$(document ).ready(function () {

// add your code here

initPublish();

$(.a).click( function (){

// add your code here

});

});

Method 3:
Copy code The code is as follows:

window.onload = function (){

// add your code here

}
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template