A concise tutorial on JavaScript scripting languages

Source: Internet
Author: User

JavaScript, which provides scripting languages, is very similar to C + +, except that it removes easily-generated errors such as pointers in C and provides a powerful class library. For people who already have C + + or C, learning the JavaScript scripting language is a very relaxing thing to do.

One, the addition of JavaScript code

JavaScript scripts are included in HTML, which becomes part of the HTML document. Combined with the HTML logo, it forms a powerful Internet programming language. You can add JavaScript scripts directly to the document:

<Script Language ="JavaScript">
JavaScript语言代码;
JavaScript 语言代码;
....
</Script>

Description

By identifying <Script>...</Script> indicating JavaScript Script source code will be placed in the meantime.

by attribute language = "JavaScript" describes what language is used in the identity, and this is the JavaScript language, which represents the language used in JavaScript.

Here's an example of adding JavaScript script to a Web document:

Test2.html

<HTML>
<Head>
<Script Language ="JavaScript">
document. Write("这是赛迪网互动学校");
document. close();
</Script>
</Head>
</HTML>

Call test2.html in the browser's window, and the "This is Sadie Interactive School" string is displayed. See Figure 2 below.

Figure 2

Description

Document. Write () is the output function of the document object that prints the character or variable value in parentheses to the window; Close () closes the output.

The <Script>...</Script> logo can be put into head> ... </Head> or <Body> ...</body>. Place the JavaScript identity

Related Article

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.