Running JQuery scripts on AJAX loaded content

前端 未结 4 1960
你的背包
你的背包 2020-12-13 07:45

I am using .load() to pull static HTML files onto my main HTML page. The scripts and selectors that I have written exist within:

$(document).ready(function()         


        
4条回答
  •  借酒劲吻你
    2020-12-13 08:08

    You can bind events to dynamically loaded content via jQuery's $.live().

    From jQuery http://api.jquery.com/live/:

    Attach a handler to the event for all elements which match the current selector, now and in the future.

提交回复
热议问题