[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]
具体可以直接看链接文章。
本文分享了提高用户脚本效率的方法,包括快速循环、元素引用、字符串匹配等技巧,并强调了避免不必要的代码运行和定时器使用的重要性。
150

被折叠的 条评论
为什么被折叠?



