3 of js-Learning methods

Source: Internet
Author: User

      1. Familiarity with the role of each JavaScript method

This requirement may sound a little unrealistic, and I think this requirement is true for large languages like C # and Java, because these language libraries are so large that no one can fully remember them, and there is no need to remember them all. For example, using Java to do Web pages and mobile phone development focus on the class library is not the same. And JavaScript is not, its built-in method function is really not much, first fully familiar with, development will be handy, for example, you may initially think that JavaScript has trim () this many languages have to go to the line of the tail space, Once you understand the JavaScript built-in libraries, you'll find that in JavaScript these methods are meant to be implemented on your own. For example, if you're going to play JavaScript from other powerful languages, you might think that JavaScript should have a MD5 encryption method, which is not, of course, but someone uses JavaScript to implement this method, JavaScript MD5. In the end, the JavaScript built-in approach is less pathetic, but many cows have written new ways to add JavaScript functionality, such as the prototype framework, which essentially extends the JavaScript base functions.

      1. Understanding DOM Programming

Understanding DOM Programming is an important lesson in learning JavaScript, because JavaScript, in addition to writing some purely data-processing logic, is changing the structure and content of XHTML dynamically to achieve the purpose of dynamically updating the interface, which relies on DOM programming. The jquery framework is well-encapsulated in this area, providing a rich DOM approach that allows you to easily find a DOM node (XHTML tag) anywhere on the page, and then perform related operations (add, delete, change, check). For those of you who have experience working with XML documents in other languages, I believe this piece will get you started.

      1. Touch and use Ajax

Today, learning JavaScript without using AJAX is an advantage of JavaScript (Ajax itself is not a JavaScript content). Ajax for users and servers are good, for users, to provide a better user experience, the most typical of a scenario: the registration page user name Usability pre-detection, the traditional may encounter such a problem: the user filled out a bunch of data after the submission of the form, the result was the server told the user was registered, To re-fill the data registration, this is very large multi-user site that is very deadly, because the user loses 10 user names may be half already used. For the server, reduce web traffic, because after Ajax, the general is to load the data on demand, not because the local update to reload the entire page. For example, a webpage occupies three screen height, we can load the content of the first screen by default, and then load the content of two or three screen when the user pulls the scroll bar down. In addition, like the Web online map application is also an example of Ajax use.

Improve
      1. In-depth understanding of the JavaScript this keyword

The role of JavaScript this is very different from that of a lot of really object-oriented development languages, and it does not always point to the current object, it will change. If you do not pay attention to this problem, it is possible to encounter the seemingly correct code error or not to execute the problem.

      1. Learn JavaScript OOP programming

OOP is a good thing, it makes programmers think about problems more organized, and the organization of code is clearer. JavaScript can also be oop, but there are also big differences with some of the traditional OOP languages, so it takes some effort to actually use the cooked JavaScript oop.

      1. Understanding closures

JavaScript closures are also a topic of much talk, and closures complicate the scope of JavaScript variables, but this feature makes the language more flexible.

      1. Learning Norm Development

Team spirit believe that we have heard a lot, the inauguration of a company to do development, of course inseparable from the team, the team want to cooperate happily, each member of the code must conform to certain norms, which is the basic requirements of each company programmer. As for the specification, it usually refers to the naming of variables, the organization of documents, the specification of annotations, and so on, which is interlinked with other language norms.

      1. Read the book for this algorithm

I think learning and using a language is not difficult, it is difficult to use the basic language of grammar and sentence to solve some complex problems. To solve some of the complex problems, some algorithms may be used, some of the implementation of the algorithm may be a team doing, such as the Chinese Academy of Sciences, the specific implementation of Word segmentation, as well as the game commonly used automatic path finding a * algorithm. Maybe you think you can't have such a complicated problem in JavaScript development, in fact, it depends on what you are doing, if you are developing a large web game, often faced with more challenging problems, if you have read some algorithmic books, to understand some of the solutions to common problems, In the development process will naturally be more powerful. In addition, familiarity with algorithms is obviously helpful in your future exposure to other development languages.

Habit
      1. Compatible, bug-related notes

CSS and JavaScript browser compatibility issues are best to take notes, because these problems, or bugs are more bizarre, these problems the browser will not prompt you wrong, the IDE will not prompt you, especially CSS compatibility issues, This will cause you to encounter such problems in the development process that the card long time will not be resolved. Even if previously solved the same kind of problem, may later encounter, the result did not take notes to strengthen the memory, doomed you to suffer again, because these compatibility problem is not one or two, temporary memory effect is not obvious. In my experience, a lot of problems occur under IE6, and now IE6 even Microsoft wants to accelerate its demise, which is of course a good news for us in front-end development.

      1. Read good code, like jquery

Reading good code is definitely a good way to improve yourself, not only to understand the organizational specifications of good code, but also to understand some of the implementation of the idea of the function. jquery, for example, is a very value-learning JavaScript framework. Of course, to read such a professional JavaScript framework, JavaScript Foundation to be solid, otherwise see the process will encounter too many doubts, even to their own confidence is a blow.

3 of js-Learning methods

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.