jQuery $(document).ready and UpdatePanels?

后端 未结 19 1522
庸人自扰
庸人自扰 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 02:02

    I would use one of the following approaches:

    1. Encapsulate the event binding in a function and run it every time you update the page. You can always contain the event binding to specific elements so as not to bind events multiple times to the same elements.

    2. Use the livequery plug-in, which basically performs method one for you auto-magically. Your preference may vary depending on the amount of control you want to have on the event binding.

提交回复
热议问题