开发者

listen for jQuery load event for a certain page

I am trying to add some functionality to my posts/new page when it loads, using jQuery. Is it possible to specifically listen to the jQue开发者_如何学编程ry page load event for any particular page?


Try this

if($("#elementId").length > 0){
    $(document).ready(function(){

    });
}

You can also use it is same as ready method.

$(function(){

});


Yes:

$(document).ready(function(){
    // Your code here
});

OR simply:

$(function(){
    // Your code here
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜