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);