jQuery研究体会

来源:互联网 发布:淘宝买电棍 编辑:程序博客网 时间:2024/04/30 16:03
 

1、return  this;支持链式调用。

2、合理使用命名空间。

3、以对象为参数,$().css()

4、去掉繁琐的new关键字,改用 return  new jQuery 实例。

5、Array.prototype.slice.call(this)   jQuery 最爱。

6、统一接口,$(#id)  $('p')  $(".className") $("html代码")