jQuery1.7在事件上做了改动,将事件绑定统一为on和off了,对以前的绑定方式继续支持. 但是在文档中没有提到的改动有以下两个:

就是jQuery的die和undelegate方法,原来在取消命名空间绑定的时候不需要前面加点,但是在1.7中是需要前面加点。如下:

1.7以前

$(".selector").die("namespace");

$(".selector").undelegate(".selector1", "namespace");

 

1.7以后

$(".selector").die(".namespace");

$(".selector").undelegate(".selector1", ".namespace");

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-12
  • 2022-12-23
  • 2022-03-15
猜你喜欢
  • 2021-11-09
  • 2021-11-18
  • 2021-11-14
  • 2021-11-18
  • 2021-05-26
  • 2022-01-03
相关资源
相似解决方案