There will be difficulties in learning any knowledge. Of course, learning JavaScript is the same. This article summarizes some of the difficulties in learning Javascript and explains each difficulty:
First, use systematic knowledge to make the problem concrete
We often do this when learning Discover that the same problem can be solved in different ways. For example, to bind a click event to an element, you can use
When we see for the second time that we can pass a function to an event to bind: a.onclick=f1; then we will think that there is more than one way to bind an event.
When we see the addachEvent("onclick",f1) method used to bind events for the third time, you will definitely think that there may be more than three ways to bind events. And there is no reason to use three identical methods to do one thing. There must be some differences between them?
So what are the differences between them? How many ways are there to bind events? When you find that a method is incompatible in IE, you still ask why? Is my grammar wrong? Or what happened. After answering questions one after another, you have to ask yourself: "Oh my god! When will I learn JavaScript well?!".
Maybe it will be difficult for you to learn JS well if this continues. In fact, I want to tell you that you are not far away from learning from him, but you just don’t know how. What's the reason? The reason is that there is no systematic knowledge. The reason is that I have not read the "JavaScript Definitive Guide". He will tell you that there are four methods for binding events, and two of them are basic methods. All browsers support them, and there are two more. Advanced methods, one is the W3C standard method, and the other is the IE standard method, so you know why IE is not compatible with one of the advanced methods, right?
Now that things are concrete, you only need to consider these four methods when binding an event, and you will no longer have so many doubts. You will also feel that you understand the event, and you should next understand other issues. You will also feel that you have finally made progress in JS. Of course, you will also feel that you have come out of a dilemma.
2. You must understand the history of JavaScript
Do you understand the history of JS? Of course I understand that it was not originally called JavaScript, and it was not first implemented in IE. Yes, it’s very well said, but it’s not the most important thing. Knowing this will not make you a master. You must understand it in more detail, and mainly understand the history of functional evolution.
Like the above, why are there so many methods for binding events? Why are there so many ways to get an element? Is document.links[] more formal? Or is getElementsByTagName('a') more formal? Which one has better compatibility? How many such methods are there?
You must know that one question is enough to give you a headache, ten questions will make you unable to start, and a hundred questions will make you doubt yourself. A thousand questions finally come back to the question "Oh my God! When can I learn JavaScript well?" Haha, that's often the case. The solution is to concretize it and understand how many methods there are and why there are these methods. There must be answers to these questions, because JS is not something left by aliens, it was created by humans, and that person's thinking is also limited, right?
When you know that document.links[] is a legacy document method, and there are a total of 5 such legacy methods. Some problems disappear when they are anchors[], applets[], forms[], images[], links[]. When you also know that the DOM standard retains them, and you also know that all browsers support them, you Also knowing that they are the so-called "Level 0 DOM" you will get out of another "dilemma".
3. JS has a crisscrossed knowledge structure
The knowledge structure of JS is crisscrossed horizontally and vertically, which makes it more difficult to understand it. You must have a clear understanding of this. Let’s explain “crisscrossing” below.
General knowledge has a horizontal nature. For example, from a large perspective, JS is divided into core part and client part. This is horizontal. The core part is divided into lexical structures, data types and values, variables, expressions and operators, statements, objects and arrays, functions, classes, modules and namespaces, and regular expressions. This is also horizontal.
The client part can be divided into BOM, DOM, events, styles, forms, etc. These are also horizontal knowledge structures.
A technology rarely uses time as a structure, but because the development of browsers is dynamic, browsers in different periods have different degrees of implementation of JS, and web pages written for the browsers at that time at different times cannot be changed because of technology The development of JS should not be considered, and it is impossible for all websites to be rewritten with the development of technology. Therefore, JS must be developed and upgraded while retaining forward support. Therefore, even if there is a better method, the previous method must be retained. There are many legacy JS properties and methods. For example, the "Level 0 DOM" has been retained in the new W3CDOM. To a certain extent, it is vertical of.
When I have a clear understanding of the knowledge structure, one advantage is that when I want to solve a problem, I can know which piece of knowledge I want to use. For example, if you want to get the position of an element in the document, you will know to use the attributes of the element in the DOM. If you want to get the position of the mouse pointer, you will use the attributes of the event object. To obtain a reference to an element, you can use the legacy DOM or the W3C standard DOM method. This is a good thing.
In fact, the core of the above question is systematization and concreteness. This is a point that I think is very important in the learning process. This really solved a lot of doubts for me.
Any knowledge and technology is the same. As long as you have studied the whole system systematically, the problems you encounter will be slowly solved and you will understand more deeply.
The above is the content that will take you out of the difficult points of learning javascript, and more For more related articles, please pay attention to the PHP Chinese website (www.php.cn)!

JavaScriptisnotbuiltonCorC ;it'saninterpretedlanguagethatrunsonenginesoftenwritteninC .1)JavaScriptwasdesignedasalightweight,interpretedlanguageforwebbrowsers.2)EnginesevolvedfromsimpleinterpreterstoJITcompilers,typicallyinC ,improvingperformance.

JavaScript can be used for front-end and back-end development. The front-end enhances the user experience through DOM operations, and the back-end handles server tasks through Node.js. 1. Front-end example: Change the content of the web page text. 2. Backend example: Create a Node.js server.

Choosing Python or JavaScript should be based on career development, learning curve and ecosystem: 1) Career development: Python is suitable for data science and back-end development, while JavaScript is suitable for front-end and full-stack development. 2) Learning curve: Python syntax is concise and suitable for beginners; JavaScript syntax is flexible. 3) Ecosystem: Python has rich scientific computing libraries, and JavaScript has a powerful front-end framework.

The power of the JavaScript framework lies in simplifying development, improving user experience and application performance. When choosing a framework, consider: 1. Project size and complexity, 2. Team experience, 3. Ecosystem and community support.

Introduction I know you may find it strange, what exactly does JavaScript, C and browser have to do? They seem to be unrelated, but in fact, they play a very important role in modern web development. Today we will discuss the close connection between these three. Through this article, you will learn how JavaScript runs in the browser, the role of C in the browser engine, and how they work together to drive rendering and interaction of web pages. We all know the relationship between JavaScript and browser. JavaScript is the core language of front-end development. It runs directly in the browser, making web pages vivid and interesting. Have you ever wondered why JavaScr

Node.js excels at efficient I/O, largely thanks to streams. Streams process data incrementally, avoiding memory overload—ideal for large files, network tasks, and real-time applications. Combining streams with TypeScript's type safety creates a powe

The differences in performance and efficiency between Python and JavaScript are mainly reflected in: 1) As an interpreted language, Python runs slowly but has high development efficiency and is suitable for rapid prototype development; 2) JavaScript is limited to single thread in the browser, but multi-threading and asynchronous I/O can be used to improve performance in Node.js, and both have advantages in actual projects.

JavaScript originated in 1995 and was created by Brandon Ike, and realized the language into C. 1.C language provides high performance and system-level programming capabilities for JavaScript. 2. JavaScript's memory management and performance optimization rely on C language. 3. The cross-platform feature of C language helps JavaScript run efficiently on different operating systems.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Dreamweaver CS6
Visual web development tools
