JavaScript Learning Guide Notes
First chapter Hello javascript!
Introduction to JavaScript
JavaScript belongs to the scripting language on the network side .
JavaScript is used by millions of of pages to improve design, verify forms, detect browsers, create cookies, and more.
The ability to integrate seamlessly with Web pages. 、
Currently in the Internet field, is also a more popular scripting language.
JavaScript is a lightweight programming language .
JavaScript is a programmatic code that can be inserted into an HTML page.
When JavaScript is inserted into an HTML page, it can be performed by all browsers.
Of these, JavaScript is not required to install any additional software, nor to configure the path of components and so on these tedious processes! It is very different from the development of Java and Android, because in these development process, you need to build the development environment and development platform so that user experience development problems and so on!
The script in the HTML must be between the <script> and </script> tags.
The script can be placed in the <body> and
<! DOCTYPE Html>
For the above code, we do not need to understand that the browser interprets and executes JavaScript between <script> and </script>.
Put JavaScript at the bottom of the page code so you can ensure that the script is executed after the <p> element is created.
Functions and events for JavaScript
We need to execute code when an event occurs, such as when the user taps the button.
If we put JavaScript code in a function, we can call it when the event occurs.
JavaScript in You can put an unlimited number of scripts in the HTML document.
The script can be in the <body> or
It is common practice to put functions in the
JavaScript functions in
<! DOCTYPE html>
External JavaScript
You can also save the script to an external file. External files typically contain code that is used by multiple Web pages.
The file name extension for external JavaScript files is. js.
To use an external file, set the. js file in the "src" attribute of the <script> tag
<! DOCTYPE html>
It is possible to refer to a script file in
This article is from the "Sun nuo" blog, please be sure to keep this source http://10479756.blog.51cto.com/10469756/1917893
The first chapter of the JavaScript Learning guide Hello javascript! Getting started with the most basic JavaScript