jQuery $(document).ready and UpdatePanels?

后端 未结 19 1732
庸人自扰
庸人自扰 2020-11-22 01:32

I\'m using jQuery to wire up some mouseover effects on elements that are inside an UpdatePanel. The events are bound in $(document).ready . For example:

19条回答
  •  离开以前
    2020-11-22 01:49

    pageLoad = function () {
        $('#div').unbind();
        //jquery here
    }
    

    The pageLoad function is perfect for this case since it runs on the initial page load and every updatepanel async postback. I just had to add the unbind method to make the jquery work on updatepanel postbacks.

    http://encosia.com/document-ready-and-pageload-are-not-the-same/

提交回复
热议问题