return FALSE; $r = well_tag_thread__update(array('id' => $id), $update); return $r; } function well_tag_thread_find($tagid, $page, $pagesize) { $arr = well_tag_thread__find(array('tagid' => $tagid), array('id' => -1), $page, $pagesize); return $arr; } function well_tag_thread_find_by_tid($tid, $page, $pagesize) { $arr = well_tag_thread__find(array('tid' => $tid), array(), $page, $pagesize); return $arr; } ?>javascript - listen for jQuery load event for a certain page - Stack Overflow
最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - listen for jQuery load event for a certain page - Stack Overflow

programmeradmin3浏览0评论

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 jQuery page load event for any particular 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 jQuery page load event for any particular page?

Share Improve this question edited Aug 10, 2011 at 3:25 Coder 2,0443 gold badges18 silver badges35 bronze badges asked Aug 10, 2011 at 3:21 rookieRailerrookieRailer 2,3412 gold badges28 silver badges48 bronze badges 1
  • 1 There is no "jQuery page load event". jQuery adds a listener that waits for a DOM ready (or similar) event to occur, then does something, falling back to the load event if it doesn't get called sooner. See bfavaretto's answer. – RobG Commented Aug 10, 2011 at 3:26
Add a ment  | 

2 Answers 2

Reset to default 5

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)

  1. 暂无评论