且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

运行在AJAX加载的内容JQuery的脚本

更新时间:2022-10-23 10:51:07

  $(文件).ajaxComplete(函数(){
    //火灾时,任何Ajax请求完成
})
 

ajaxComplete()

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(){});

But they don't work on the AJAX loaded content. I have read that this is because the selectors that I am using are not available.

Is there a better way to do this? Adding the script to the window.load function doesn't work either:

$(window).load(function() {});

$(document).ajaxComplete(function(){
    // fire when any Ajax requests complete
})

ajaxComplete()