Although "efficient JavaScript code writing skills" is not a long online article, it is a good story. The author focuses on how to perform Dom operations more efficiently and makes a variety of experienced analyses and summaries. Some are language encoding techniques (such as loops), some are problems to be overcome due to browser limitations, some are common traps, and how should we pay attention to and avoid them. More importantly, the author not only states the symptom of the problem, but also provides incorrect examples and negative examples while listing the solution to the problem, so that readers can better compare them, through the "comparison method", you can quickly understand the differences and nuances.
In: http://www.nowamagic.net/javascript/js_EffectiveJavascriptCoding.php
Note:
Edit 2011-10-10: I feel very good to supplement my previous views --
For dynamic HTML programming, ie implements two sets of models: one is a narrow DHTML that focuses on innerhtml and the other is a set of operations (appendchild) dom (Document Object Model) of the page Element Object ). DHTML method (the DHTML method I mentioned in this Article refers to the programming method for innerhtml operations by default, not the DHTML method in the broad sense .) The direct operation of HTML code snippets mainly relies on web programmers to use String concatenation to generate page elements. This is an efficient dynamic page operation method, but it seems to be less appealing to programming logic, A large number of incomplete HTML code fragments are often distributed in the code. Dom-based dynamic page programming is a logical operation on sets and element objects. The programming logic is clear, but there are some differences in efficiency. The specific method used to implement dynamic web pages is usually a matter of personal preferences, unless the efficiency must be more efficient.