In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "what language is javascript". Friends who are interested might as well take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn what language javascript is.
Javascript is an object-based and event-driven scripting language with relative security and widely used in client-side web development. It is also a scripting language widely used in client-side Web development. It is often used to add a variety of dynamic functions to web pages and provide users with a more smooth and beautiful browsing effect.
The operating environment of this tutorial: windows7 system, javascript1.8.5 version, Dell G3 computer.
JavaScript is an object-based and event-driven scripting language with relative security and widely used in client-side web page development, as well as a scripting language widely used in client-side Web development.
It has been widely used in Web application development, often used to add a variety of dynamic functions to web pages, and provide users with a more smooth and beautiful browsing effect.
It was first used on HTML to add dynamic functions to HTML pages, a case-sensitive client scripting language developed from Netscape's LiveScript that inherits object-oriented dynamic types. The main purpose is to solve the problem of speed left over by server-side languages, such as Perl, and to respond to various operations of users, so as to provide customers with more smooth browsing results. Because the server needs to verify the data at that time, because the speed of the network is very slow, only 28.8kbps, the verification step wastes too much time. So Navigator, the browser of Netscape, joined Javascript to provide the basic functions of data validation. Now, however, JavaScript can also be used for web servers, such as Node.js.
I. the composition of javascript
A complete JavaScript implementation consists of the following three different parts:
ECMAScript: describes the syntax and basic objects of the language
Document object Model (Document Object Model, DOM): describes the methods and interfaces for dealing with web content.
Browser object Model (Browser Object Model, referred to as BOM): describes the methods and interfaces that interact with browsers.
Second, the basic characteristics of javascript
Is an interpretive scripting language (the code is not precompiled).
It is mainly used to add interactive behavior to HTML pages.
You can embed a HTML page directly, but writing it as a separate js file facilitates the separation of structure and behavior.
III. Characteristics of javascript
Unlike server-side scripting languages, such as PHP and ASP,JavaScript, are mainly run on users' browsers as client-side scripting languages and do not require server support. So in the early days, programmers preferred JavaScript to reduce the burden on the server, while at the same time brought another problem: security.
With the strength of the server, although today's programmers prefer to run scripts on the server side to ensure security, JavaScript is still popular for its cross-platform, easy-to-use and other advantages. At the same time, some special features, such as AJAX, must be supported on the client side by relying on Javascript. With the development of engines such as V8 and frameworks such as Node.js, and their event-driven and asynchronous IO features, JavaScript is gradually used to write server-side programs.
4. JavaScript is commonly used to accomplish the following tasks
1. Embed dynamic text into HTML pages
2. Respond to browser events
3. Read and write HTML elements
4. Verify the data before it is submitted to the server
5. Detect the browser information of visitors
6. Control cookies, including creation and modification
5. How to use Javascript
There are two ways to add Javascript to a web page: directly and by reference.
1. Direct way
This is the most commonly used method, which is used by most web pages with Javascript, such as:
Simple JavaScript Hello World [xss_clean] ("Hello,!"); / / display alert ("Hello,!") directly in the browser window; / / pop-up window shows console.log ("Hello,!") / / when displayed in the console (console), you need to open the contents of the HTML page of the development tools console first.
In this example, we can see a new label: …... Which is used to tell the browser that this program is written in Javascript and needs to be interpreted by an appropriate interpreter. (W3C has recommended the use of new standards
Note that when inserting script tags in non-xhtml documents, if you are not referencing an external file, you should add a cdata declaration to the script to avoid browser parsing errors caused by the greater and smaller operators.
2. Citation method
If a Javascript source file already exists (usually with the extension js), you can use this reference to improve the utilization of the program code. The basic format is as follows:
The Url is the address of the program file. Similarly, such statements can be placed in the header or any part of the body of the HTML document. If you want to achieve the effect of the example in Direct insert mode, you can first create a Javascript source code file "Script.js" with the following contents:
[xss_clean] ("this is Javascript! use the direct insertion method!")
You can call the program in a web page like this:.
You can also make a version of javascript when you import the file, for example:
Note: everything in the script tag that specifies the src attribute will be ignored.
At this point, I believe you have a deeper understanding of "what language javascript is". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.