Home > Article > Web Front-end > What language is JavaScript?
Javascript is a scripting language that is object- and event-driven, relatively safe, and widely used in client-side web development. It is also a scripting language that is widely used in client-side web development. It is often used for web pages. Add a variety of dynamic functions to provide users with a smoother and more beautiful browsing effect.
The operating environment of this tutorial: Windows 7 system, JavaScript version 1.8.5, Dell G3 computer.
JavaScript is a scripting language that is object- and event-driven, relatively safe, and widely used in client-side web development. It is also a scripting language that is widely used in client-side web development.
It has been widely used in web application development and is often used to add various dynamic functions to web pages to provide users with smoother and more beautiful browsing effects.
was first used in HTML to add dynamic functions to HTML web pages. It is a prototype-inherited object-oriented dynamic type case-sensitive client script language developed from Netscape's LiveScript. The main purpose is to solve the speed problems left by server-side languages, such as Perl, and respond to various user operations, providing customers with a smoother browsing effect. Because the server needed to verify the data at that time, because the network speed was quite slow, only 28.8kbps, the verification step wasted too much time. So Netscape's browser Navigator added Javascript to provide basic functions of data verification. However, JavaScript can now also be used in web servers such as Node.js.
A complete JavaScript implementation is composed of the following 3 different parts:
ECMAScript: describes the language The syntax and basic objects of Model (BOM for short)): describes the methods and interfaces for interacting with the browser.
2. The basic characteristics of javascript
<html> <head> <title>简单的JavaScript Hello World</title> <script type="text/javascript"> document.write("Hello, PHP中文网!"); // 在浏览器视窗内直接显示 alert("Hello, PHP中文网!"); // 弹窗显示 console.log("Hello, PHP中文网!"); // 在控制台(console)里显示,需要先开启开发工具控制台 </script> </head> <body> HTML页面内容…… </body> </html>In this example, we You can see a new tag:
3f1c4e4b6b16bbbd69b2ee476dc4f83a...2cacc6d41bbb37262a98f745aa00fbf0
, andee7daa49a56abfe5e8409b7b65ffb3c0
is used to tell the browser that this is Programs written in Javascript need to mobilize the corresponding interpreter for interpretation. (w3c has recommended the use of new standards:3d1df40a5050db9df35681b82c2528de)
Note that when inserting script tags in non-xhtml documents, if they are not referencing external files , a cdata statement should be added to the script to avoid browser parsing errors caused by the greater than and less than operators
2. Reference method
<script src=“url” type="text/javascript"></script>The Url is the address of the program file. Likewise, such statements can be placed in the head or any part of the body of an HTML document. If you want to achieve the effect of the example in "Direct Insertion Method", you can first create a Javascript source code file "Script.js" with the following content:
document.write("这是Javascript!采用直接插入的方法!");
在网页中可以这样调用程序:c2b992906fc368867610d61ab35ef6532cacc6d41bbb37262a98f745aa00fbf0
。
也可以同时在导入文件时制定javascript的版本,例如:3307c2a9026f75b96448a0777eb4891a2cacc6d41bbb37262a98f745aa00fbf0
注意:凡是指定了src属性的script标签里的内容都会被忽略。
【推荐学习:javascript高级教程】
The above is the detailed content of What language is JavaScript?. For more information, please follow other related articles on the PHP Chinese website!