The answer to this question is different for different people. For programming veterans, to learn JavaScript, you may only need to look at references and the source code of some script libraries. If you have any questions, go to places like stackoverflow or Zhihu.
Learning Javascript, first of all, it has little to do with Java, so you don’t need a Java foundation, but you must at least have a HTML foundation, otherwise even if you learn it, you won’t know it. How to use it better and more effectively. It is easier to learn HTML. If the requirements are not too high, you can take a look at CSS and div later.
HTML
Hyper Text Markup Language (Hyper Text Markup Language), an application under the standard universal markup language. HTML is not a programming language, but a markup language, which is necessary for web production.
"Hypertext" means that the page can contain pictures, links, even music, programs, etc. Non-text elements.
The structure of hypertext markup language includes a "head" part (English: Head) and a "body" part (English: Body). The "head" part provides information about the web page, and the "body" part provides The specific content of the web page.
CSS (Cascading Style Sheets)
Cascading Style Sheets (full English name: Cascading Style Sheets) is an application used to express HTML (Standard Common Markup Language) ) or XML (a subset of Standard Universal Markup Language). CSS can not only statically modify web pages, but can also cooperate with various scripting languages to dynamically format various elements of web pages.
CSS can perform pixel-level precise control over the layout of element positions in web pages, supports almost all font size styles, and has the ability to edit web page objects and model styles.
Requires perseverance. JS is not that easy to learn. There are many incredible things about the language itself, such as self, C, and Java. It is not easy to understand its programming ideas, closures, and prototypes.
Moreover, the implementation of different browser engines is different, which will lead to many problems that need to be paid attention to outside the language, especially IE. There will be a lot of mines when using it, and it is normal to get hit by mines from time to time. Therefore, learning requires perseverance to overcome. Of course, if you have no programming foundation, those mines may not be mine to you.
Need to read good books.
"The Definitive Guide to JavaScript", as its name suggests, it is indeed authoritative. Of course, this book is very thick, and not all parts of it are well explained (I was fooled by the object type section, and I didn’t wake up until I read Yu Gong’s blog post).
But this book at least gives you a complete understanding of all aspects of JS. "Pro JavaScript" is also a good book. "the good parts of JavaScript" is an important book. A bad book will teach you a lot of bad programming habits, including not writing semicolons, messing with global variables and other stupid behaviors.
The above is the detailed content of What to learn before learning js. For more information, please follow other related articles on the PHP Chinese website!