// Download Size Optimization:
I. compression tools
ESC-1.14
E: ESC-1.14> cscript esc. wsf-l 4-ow E: jssrc. js E: jsnew. js
-L leval level [0-4] 0 Merge multiple js, 1 comment 2 remove space 3 Remove line feed 4 simplify variable naming
-The first parameter after ow is the original file, and the second parameter is the post-execution file. Multiple files are separated by Spaces
Ii. When writing code
(1) Shorten the negative judgment obj! = Null =>! Obj
(2) define the Array var arr = new Array () ;=> var arr = [];
(3) define an empty Object var obj = new Object () ;=> var obj = {};
(4) define an object in JSon format
// Optimization of Running Efficiency
(1) do not forget var when defining variables; otherwise, it becomes a window object.
(2) Use local variables whenever possible
(3) Sending and switching cycles with High Performance
(4) do while has higher performance than while
(5) prioritize the use of built-in Methods
(6) store common values
(7) Saving on Dom. If you replace the table content of a div, it is better to change InnerHTML of div than to operate a large number of table dom.