What is JavaScript?
JavaScript is a scripting language widely used in client web page (browser) development. It is used to add dynamic functions to HTML web pages, such as responding to various user operations. JavaScript is an object- and event-driven scripting language with security capabilities. In most cases, it is executed by web browsers.
JavaScript is a registered trademark of Sun Corporation of the United States. The latest version of JavaScript is version 1.9. It follows the ECMA-262 standard (ECMAScript) of Ecma International (formerly the European Computer Manufacturers Association). This version is still under development. .
JavaScript Features
Scripting language
JavaScript is a scripting language that uses small program segments to implement programming. Like other scripting languages, JavaScript is an interpreted language that is translated line by line when executed by the browser.
Object-based language
JavaScript is an object-based language and can also be considered object-oriented, which means that it can use objects that it has created. Therefore, much functionality can come from the interaction of methods of objects in a scripting environment with scripts.
Simplicity
Writing JavaScript is very simple. You don’t need to install a specific development environment. You only need a simple Notepad to write JavaScript scripts. It has basic program syntax and language structures as well as weak data types, which are easy to learn and use.
Security
JavaScript is a security language. It does not allow access to the local hard disk, and cannot store data on the server. It does not allow modification and deletion of network documents. It can only achieve information browsing or dynamic interaction through the browser. , thereby effectively preventing data loss.
Dynamic
JavaScript is dynamic and can respond directly to user input without going through a web service program. It responds to users in an event-driven manner. The so-called event-driven refers to the action generated by performing a certain operation on the web page, which is called an "event": for example, pressing the mouse, moving the window, selecting the menu, etc. can be regarded as events. When an event occurs, it may cause a corresponding JavaScript event response.
Cross-platform
JavaScript is executed by a web browser and has nothing to do with the operating system environment. As long as the computer can run the browser and the browser supports JavaScript, it can be executed correctly.
The difference between JavaScript and Java
JavaScript and Java are two completely different languages. Developed by Sun Corporation, Java is a more complex and powerful language and is used in various situations.