JavaScript learning process and experience Summary _ basic knowledge

Source: Internet
Author: User
Tags md5 md5 encryption java web

First, the preface
In the past, JavaScript was used to do simple web effects, such as form validation, floating ads, and so on, so JavaScript didn't get much attention at the time. Since the start of Ajax, people have found that using JavaScript can give users a better experience, and even use this advantage to develop a large web game, so the small language is valued. Now, many companies recruit specialized JavaScript engineers, and JavaScript is often the essential skill of web front-end development. Simple introduction of the benefits of javascriptr, does not mean that everyone will go to learn and even learn it, interest is very important, I think the interest is the best teacher, it is you concentrate on doing one thing and make it a good motivation. In addition, we have to believe that small language has a big, I have used Greasemonkey wrote some very practical tools, such as you can use Javascript+greasemonkey to write online Web game plug-in program. Here's how I learn about JavaScript and my experience.

second, Getting Started
1. Learn Div+css layout

Using the DIV+CSS Layout standard Web page, you can make the front-end XHTML code less and more structured, which makes it easy to manipulate DOM with JavaScript, for example, to show a list of 3 rows and 3 columns, and if you use a traditional table layout, now you need to dynamically generate this list with JavaScript , then you need a loop nesting, if you use the LI structure and CSS floating layout, a cycle is good. Of course, web standardization is not necessarily the inability to use tables, I mean structured XHTML is easier to integrate JavaScript effects or features into your project.

2, master several development test tools

As a developer, it is necessary to familiarize yourself with the test tools, which can help improve your efficiency in discovering and solving problems, especially for large projects. JavaScript and XHTML Development Test Tool I first recommend two most commonly used, these are: Web developer and Firebug.

3, familiar with the role of JavaScript each method

This may sound a little bit impractical, and I think it's true for large languages like C # and Java, because these language libraries are so huge that no one can remember them all, and there's no need to remember them all. For example, the use of Java Web pages and mobile phone development concerns of 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 also be handy, for example, you may start to think that JavaScript has a lot of language to go to the wardrobe line of the end of space method, When you understand JavaScript's built-in library of functions, you'll find that these methods are intended to be implemented by yourself in JavaScript. For example, if you are turning from other powerful languages to play JavaScript, you may think that JavaScript should have MD5 encryption, of course, but it is not, but some people use JavaScript to implement this method, that is, JavaScript MD5. After all, the JavaScript built-in approach is pathetic, but many cows have written new ways to add JavaScript functionality, such as the prototype framework, which is essentially a prototype extension of JavaScript based functions.

4. Understanding DOM Programming

Understanding DOM Programming is an important lesson in learning the JavaScript process, because JavaScript, in addition to writing some pure data-processing logic, is dynamically changing the structure and content of XHTML to achieve the purpose of dynamic interface updates, which depend on DOM programming. The jquery framework is pretty well encapsulated in this area, providing a rich DOM manipulation that allows you to easily find a DOM node (XHTML tag) anywhere on the page, and then do the relevant work (add, delete, change, check). For friends who have had experience with XML documents in other languages, I believe this piece is going to work quickly.

5. Contact and use Ajax

Today, learning JavaScript without using AJAX is an advantage to burying JavaScript (Ajax itself is not a JavaScript content). Ajax is good for both the user and the server, for users, to provide a better user experience, the most typical of a scenario: registration of the user name of the page availability of pre-detection, the traditional may encounter such a problem: the user filled out a pile of information to submit the form, the result was the server told the user was registered, It is fatal for a large multi-user site to have the user fill in the data register, because half of the user loses 10 user names and may have been used. For the server, reduce web traffic, because after Ajax, generally on-demand loading of data, not because of local updates and reload the entire page. For example, a Web page for three screen high, we can default to only load the first screen content, when the user pulls down the scroll bar, then load two or three screen content. Another example is the use of Ajax as a Web online map application.

third, improve
1. Deep understanding of the JavaScript this keyword

The role of JavaScript this is very different from pointing to a lot of real object-oriented development languages, and it doesn't always point to the current object and it changes. If you do not pay attention to this problem, it is possible to encounter seemingly correct code error or do not execute and so on.

2. 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 it's also a big difference from some traditional OOP languages, so it takes a bit of effort to really use JavaScript oop.

3, to understand the closures

JavaScript closures are also a much discussed topic, and closures make JavaScript variable scopes more complex, but this feature makes the language more flexible.

4. Learning Standard Development

Team spirit believe that we have heard a lot of, the inauguration of a company to do development, of course, can not be separated from the team, the team to want to cooperate happily, each member of the code must conform to a certain standard, which is the basic requirements of each company programmer. As for the specification of variable naming, file organization, annotation specification and so on, this aspect knowledge and other language's specification are interlinked.

5, find this algorithm of the book read

I think that learning and using a language is not difficult, it is difficult to use the language of the basic grammar and sentence to solve some complex problems. To solve some complex problems, may use some algorithms, some algorithms may be a team to do, such as the Chinese Academy of Sciences to achieve the specific word, in addition to the game commonly used automatic path-seeking a * algorithm. Maybe you think you can't have such a complicated problem with JavaScript development, but it depends on what project you are working on, if you are developing a large web game, you often face more challenging challenges, if you have read some algorithmic books, understand some of the common problems of the solution, In the development process will be more powerful. In addition, familiarity with the algorithms is obviously helpful for your future exposure to other development languages.

Iv. Habits
1, compatibility, bug issues to do notes

CSS and JavaScript browser compatibility issues best to take notes, because these questions, or the bug is more bizarre, these problems browser will not prompt you where the wrong, the IDE will not prompt you, especially CSS compatibility issues, This will cause you to encounter such a problem in the development process that the card will not be solved for a while. Even if you have solved a similar problem before, you may encounter again, the results did not make 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 happen under the IE6, now IE6 even Microsoft itself wants to accelerate its demise, which for the front-end development of us is of course a good news.

2, read the good code, such as jquery

Reading excellent code is definitely a good way of self-improvement, not only to understand the excellent code of the organization, but also to understand some of the functions of the implementation of ideas. For example, jquery is a very value-learning JavaScript framework. Of course, to read such a professional JavaScript framework, JavaScript Foundation should be solid, otherwise see the process will encounter too many questions, even to their own confidence is a blow.

Iv. attention
1. Avoid using JavaScript framework for development prior to JavaScript entry

If you don't have any JavaScript basics, don't develop it directly using JavaScript frameworks, which I think might mislead you into a language, such as using jquery to use dots to connect Do you think this is a kind of javascript grammar? Again, for example, you made prototype. You do not think of the base class method after the frame is expanded to be JavaScript built. I think the JavaScript framework is designed to be more efficient, and it's definitely not a JavaScript primer to learn from.

2. Many examples on the Internet may not be cross-browser compatible

There are a lot of JavaScript effect source is n years ago a netizen wrote, n years ago is the world of IE, so some front-end lazy to solve the scripting Cross-browser compatibility issues, so that the written script is only applicable to IE. When you get such a piece of code, please do not say garbage, do not complain about it, because the code is not without any value, if you understand JavaScript cross-browser compatibility issues, I believe you can easily through the need to modify the code to better compatibility.

v. Related reading
"JavaScript Development Specification Requirements"

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.