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. We can use an example to write the first JavaScript program. It shows how JavaScript scripts are embedded in HTML documents. 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.
Through the attribute language = "JavaScript" description of what language is used in the identity, the JavaScript language, which represents the language used in JavaScript. Here's an example of adding JavaScript script to a Web document:
<title>嵌入JavaScript的事例</title>
<Script Language ="JavaScript">
<!--
document.Write ("这是一个嵌入
JavaScript的事例");
document. close();
-->
</Script>
<body>
</body>
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. <Script>...</Script> logo can be put into the