Notes on efficient JavaScript coding skills

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.