最新消息:本站所有跳转向bbs.ykit.cn的附件将全面停止,附件已转移到https://www.qingsj.com

jquery load() 加载页面到指定位置 js不执行

jquery 有客 315浏览

把要异步加载的页面中,需要执行的js,写在load()方法的回调函数中执行:

$(selector).load(url,data,function(response,status,xhr))

$('.layui-tab-content').load("../index.html",function () {
   //这里是异步加载的index.html页面 需要执行的js
});

转载请注明:有客帮 » jquery load() 加载页面到指定位置 js不执行