[url]http://userjs.org/help/tutorials/efficient-code[/url]
Table of contents
[list]
[*]Fast loops
[*]Referencing elements
[*]String matching
[*]Create once, use repeatedly
[*]eval is evil
[*]Only listen to what you need
[*]Avoid running unnecessary code
[*]Timers take too much time
[*]Take a short circuit
[*]Reduce reflow
[*]Assign multiple styles
[/list]
具体可以直接看链接文章。
Table of contents
[list]
[*]Fast loops
[*]Referencing elements
[*]String matching
[*]Create once, use repeatedly
[*]eval is evil
[*]Only listen to what you need
[*]Avoid running unnecessary code
[*]Timers take too much time
[*]Take a short circuit
[*]Reduce reflow
[*]Assign multiple styles
[/list]
具体可以直接看链接文章。