星空网 > 软件开发 > ASP.net

ajax局部刷新后里面的jquery事件失效的解决方法

live()

  与bind()作用基本一样。

  最重要区别:live()可以将事件绑定到当前和将来的元素(eg:为id=zy元素绑定点击事件,而当你用js动态生成一个节点并插入到dom文档结构中时,如果你是用bind()绑定的,怎么新插入的节点将不会有该bind绑定事件。而live()则可以);

  缺点: 无法用于链式结构。

      eg:  $('选择器').live('click',function(){  }) ;    正确写法  例如:$('#test').live('click',function(){  }) ;

         $('.class').find('span').live('click',function(){  })   错误写法  无效

  live()绑定的事件可用 die()方法解除绑定。

以上引用自:http://www.cnblogs.com/zony/articles/jquery.html

 

 using (Ajax.BeginForm("GetBasicInformation", "Employee", new AjaxOptions { UpdateTargetId = "basicInfo", LoadingElementId="loading", LoadingElementDuration = 3000, Url = Url.Action("GetBasicInformation"), HttpMethod = "Post" }, new { @class = "profileForm", id = "BasicInformation"  }))

{

}

 




原标题:ajax局部刷新后里面的jquery事件失效的解决方法

关键词:jquery

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

旺季售后问题:https://www.goluckyvip.com/tag/12218.html
旺季促销技巧:https://www.goluckyvip.com/tag/12219.html
年终旺季在即:https://www.goluckyvip.com/tag/1222.html
日本热销产品:https://www.goluckyvip.com/tag/12220.html
日本电商市场:https://www.goluckyvip.com/tag/12221.html
j竞品分析:https://www.goluckyvip.com/tag/12223.html
北京丰台区水上乐园哪家好玩?:https://www.vstour.cn/a/366177.html
23点聊电商:“潮起钱塘·境遇未来”2024年跨境电商全平台发展大会圆满完成 :https://www.kjdsnews.com/a/1836652.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流