What does JavaScript mean _javascript skills

Source: Internet
Author: User
Tags arithmetic arithmetic operators logical operators object model

JavaScript is a literal translation script language, a dynamic type, a weak type, a prototype based language, and a built-in support type. Its interpreter, known as the JavaScript engine, is widely used as a scripting language for clients, and is used in HTML (an application under standard Universal Markup Language) to add dynamic functionality to HTML Web pages.

JavaScript is a scripting language developed by Netscape's livescript, which improves compatibility with Java. JavaScript uses HTML pages as its interface

In order for the Web page to be interactive and to contain more active elements, it is necessary to embed other technologies in the Web page. Such as: JavaScript, VBScript, Document Object model (file target module), layers and cascading Style Sheets (CSS), which mainly talk about JavaScript.

So what is JavaScript? JavaScript is a new programming language that is adapted to the needs of dynamic web-making, and is now increasingly used in Internet web page production.

JavaScript is a scripting language developed by Netscape (scripting language), or a descriptive language. On the basis of HTML, you can use JavaScript to develop interactive Web pages. The advent of JavaScript enables a real-time, dynamic, interactive relationship between Web pages and users, which includes more active elements and more exciting content. Running programs written in JavaScript requires browsers that support JavaScript languages.

Netscape Company Navigator 3. More than 0 versions of browsers support JavaScript programs, Microsoft Internet Explorer 3. More than 0 versions of browsers basically support JavaScript. Microsoft also has its own development of JavaScript, called JScript. JavaScript and JScript are basically the same, except in some detail. JavaScript is short and is executed on the client, which greatly improves the browsing speed and interactive ability of the Web page. It is also a simple programming language tailored for making Web pages.

While Dreamweaver's behaviors can be a handy way to use JavaScript programs without writing code, we know the JavaScript programming method more easily and flexibly, and make JavaScript code more concise. This topic through the analysis of a series of typical procedures, so that you quickly grasp the JavaScript programming skills, design a high-quality Dynamic Web page to lay a solid foundation. Before that, let's start with some basic concepts of JavaScript.

What are the features of JavaScript?

JavaScript makes Web pages more interactive. JavaScript simplifies regular, repetitive HTML paragraphs and reduces download time. JavaScript can respond to the user's actions in a timely manner, do a real-time check on the submission form without wasting time with CGI validation. The features of JavaScript are endless, as long as you are creative.

What is the difference between Java and JavaScript

Many people see Java and JavaScript have "Java" four words, think they are the same thing, even I was the same. In fact, they are two completely different kinds of things. Java, the full name should be Java applet, is embedded in the Web page, but also has its own independent run window applet. Java applets are precompiled, and an applet file (. Class) opens reading in Notepad, which is simply incomprehensible. Java applets are powerful, with access to protocols such as HTTP, FTP, and even viruses on the computer (there is a precedent). In contrast, JavaScript is less capable. JavaScript is a "script" that writes code directly into an HTML document that the browser compiles and executes when it reads them, so you can view the JavaScript source code by viewing the HTML source file. JavaScript does not have a separate running window, and the browser's current window is its running window. The similarities, I think, are just the same as programming languages in Java.

What software should be used to develop JavaScript

A JavaScript program is actually a document, a text file. It is embedded in an HTML document. So any software that can write HTML documents can be used to develop JavaScript. Here I recommend you use the Microsoft Script Editor included with FrontPage 2000 (in the FrontPage menu | Tools | Macros | Microsoft Script Editor). It is a program developer like Visual Basic/c++, which can give a brief hint of the statement being entered. With FrontPage 2000, the workload is greatly reduced.

The use of JavaScript in Web pages

There are two ways to add JavaScript to a Web page:

1, directly add HTML documents

This is the most common approach, and most Web pages that contain JavaScript use this approach, such as:

<script language= "Javascript" >
<!--
Document.writeln ("This is javascript! Use the direct insertion Method! ");
-javascript End-->
</script>

In this example, we can see a new tag: <script>......</script>, while <script language= "Javascript" > Used to tell the browser that this is a program written in JavaScript that needs to be adjusted to explain it.

HTML annotation Tags <!--and: Used to remove JavaScript source code that is not recognized by browsers, which is useful for browsers that do not support JavaScript language.

-javascript end: The double slash represents the annotation portion of JavaScript, where characters from//start to end of line are ignored. As to the document used in the procedure. The Write () function indicates that the text in parentheses is exported to the window, which is described in more detail later. Another point to note is that the location of the,<script>......</script> is not fixed and can be included in < head>......

2, reference mode if there is already a JavaScript source file (with JS as the extension), you can use this reference to improve the utilization of program code. The basic format is as follows:

<script src=url language= "Javascript" ></script>

The URL of which is the address of the program file. Similarly, such statements can be placed in the head of an HTML document or in any part of the body. If you want to achieve the effect of the example shown in direct Insert, you can first create a JavaScript source code file, "Script.js," which reads as follows:

Document.writeln ("This is javascript! Use the direct insertion Method! ");

You can call the program in a Web page: <script src= "script.js" language= "Javascript" ></script>.

Second, the basic concept of javascript

Here is only a brief introduction, in the future example of the knot program to explain its role.

1, operator

An operator is a sequence of symbols that is done and has seven classes:

Assignment operators, arithmetic operators, comparison operators, logical operators, conditional operations, bitwise operator operators, and string operators.

2. Expression type

The combination of operators and operands, called expressions, is typically divided into four classes: assignment expressions, arithmetic expressions, Boolean expressions, and string expressions.

3, statements

A JavaScript program consists of several statements, which are instructions for writing a program. JavaScript provides a complete set of BASIC programming statements, which are:

An assignment statement, a switch selection statement, a while loop statement, a For Loop statement, a do-while loop statement, a break loop abort statement, and a continue loop interrupt statement.

4. function

A function is a named segment of a sentence that can be used as a whole to draw off and execute. Use functions to note the following points:

1 functions are defined by the keyword function;

2 function must be defined before use, otherwise there will be an error;

3 The function name is the name that is referenced when calling the function, it is sensitive to case, and cannot write the wrong function name when calling functions;

4 The parameter represents the value passed to the function or operation, which can be a constant or a variable;

5 The Return statement returns the value of an expression, or it can not.

5. Object

An important function of JavaScript is the object-based function, which can be developed in a more intuitive, modular and reusable way through object-based programming.

A set of properties that contain data and a method for manipulating data in a property, called an object. For example, to set the background color of the Web page, the object is the document, the property name used is bgcolor, such as document.bgcolor= "Blue", that is to make the background color blue.

6. Events

An action that occurs when a user interacts with a Web page, called an event. Most of the things are triggered by the user's action, such as: the user presses the mouse button, on the production of onclick events, if the mouse pointer to the link on the move, resulting in onmouseover events and so on. In JavaScript, events are often used in support of event handlers.

Learning JavaScript faster and more effective way is to familiarize yourself with some basic concepts, and then find a few other people design the program carefully and carefully analyzed again, a little change, and then see whether to achieve the desired purpose, constantly extrapolate, can deepen the understanding of some parameters, design methods, And can quickly improve their level. In addition, to remind: JavaScript is sensitive to the case, especially some objects, methods, attributes must be consistent, to develop a good habit, otherwise in the debugging process will be exhausted you.

7, variable

such as var myvariable = "some value";

The above is a small set to introduce the JavaScript is what the meaning of all the narrative, hope to help everyone, if you have any questions please give me a message, small set will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.