jQuery ready event not fired on partial page load

后端 未结 5 1407
春和景丽
春和景丽 2021-01-13 00:14

Here\'s the situ: A page which contains html and using the jQuery libray and tabs jQuery UI plugin loads another page when some tab is clicked. The problem is that when the

5条回答
  •  旧巷少年郎
    2021-01-13 00:46

    OK.. so i have a simple answer to this problem now, which should mean minimal code changes. Rather than the sub views (these are real aspx views which have no html, head or body tags) having a js include (essentially the client side behaviour model) which responds to $(document).ready, we can use the suggestion from mkedobbs to provide something similar. Simply:

    $("#MyDiv").load("page.htm", null, function(){ $(document).trigger("PartialLoaded"); });
    

    Then in the sub view js include

    $(document).bind("PartialLoaded", function(){ .........});
    

提交回复
热议问题