使用 pjax 载入的新页面,点击事件无法触发的解决方案
在页面上有定义类似
$(".class").click(function(){
...
})
经过pjax 载入后的新页面 点击后没有触发事件
解决方法:
在父框架上的document上绑定方法
$(document).on("click",".class",function(){
//code
});
在页面上有定义类似
$(".class").click(function(){
...
})
经过pjax 载入后的新页面 点击后没有触发事件
解决方法:
在父框架上的document上绑定方法
$(document).on("click",".class",function(){
//code
});
发表评论 | 暂无评论