首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

八个能够有效帮助你提高jQuery代码性能(performance)的技巧

2012-09-02 
8个能够有效帮助你提高jQuery代码性能(performance)的技巧来源http://www.gbin1.com/technology/jquery/20

8个能够有效帮助你提高jQuery代码性能(performance)的技巧
来源http://www.gbin1.com/technology/jquery/20120222jqueryxingneng/index.html

选择器Selector的使用

id > tagname > attrName > class > 伪类

链式调用(chaining)

对处理多个方式时 只需要查询一次jquery 对象
  如

var data = ["Saab","Volvo","BMW"];    tmp = ''; $.each(data, function(i, item){    tmp +='<div>' + item + '</div>';});$("#gbcontainer").append(tmp);    


使用第二种操作

热点排行