The internet era has created our new work and way of life, its interconnection, openness and sharing of information mode, breaking the traditional way of information dissemination of the numerous barriers, to bring us new opportunities. With the advent of the computer and Information age, the pace of human society is gradually accelerating, every day there are new things happen every day in the creation of miracles. With the rapid development of Internet technology, all walks of life are joining the internet industry. The internet can bring limitless vitality, both from management and from a business standpoint. Through the Internet, can achieve regional, collective and even personal connection, so as to achieve a "unified harmony." Then how to add their own or the company's information resources to the WWW server, is the majority of users increasingly concerned about the problem. Using Hyper-chain technology (Hyper-text and hypermedia technology) is the simplest and quickest way to achieve this goal. The specific support environment for this means is the HTML Hypertext Markup Language. They make the Web pages you want.
The linking of hypertext (Hyper Text) and Hypermedia (Hyper Media) technology combines hyperlinks (Hyper link) to organize information into a network structure (web) that forms a network document that enables "roaming" over the Internet. Through the description of the HTML symbol can realize the text, form, sound, image, animation and other multimedia information retrieval.
However, the use of this hyper-chain technology has a certain flaw, that is, it can only provide a static information resources, the lack of dynamic client and server-side interaction. Although some interaction can be achieved through the CGI (Common Gateway Interface) Common Gateway Interface, because of the complexity of programming, this method has prevented the development of Internet technology for some time. And the advent of JavaScript, the chance for Internet users to bring the network. It can be said that the emergence of JavaScript is the demand of the times, is today's information age makes JavaScript.
The appearance of JavaScript, it can make the information and users is not only a relationship between display and browsing, but to achieve a real-time, dynamic, and the ability to express the expression. Thus, a CGI-static HTML page is replaced by a Web page that provides dynamic real-time information and responds to customer actions. JavaScript scripts are the language that is the result of satisfying this requirement. It is well received by popular users. It is an excellent one in many scripting languages, and its combination with WWW effectively realizes the blueprint of Network Computing and network computer. The non-condensed Java family will dominate the Internet network. Therefore, as soon as possible to master JavaScript scripting language programming method is the growing concern of our customers.
One, what is JavaScript?
Two, Java and JavaScript differences
Three, JavaScript program running environment
Java Runtime Environment
Software Environment:
Windows 95/98 or Windows NT.
Netscape Navigator x.0 or Internet Explorer x.0.
A character editor (WS, WPS, Notepad, WordPad, and so on) or an HTML document editor for editing HTML documents.
Hardware configuration:
You must first have a basic hardware configuration environment running Windows 95/98 or Windows NT. Recommended:
Basic memory 32M.
CRT only needs 256 colors, resolution above 640x480.
The CPU is only less than 233.
Mouse and other external settings (selected as required).
Iv. writing the first JavaScript program
Let's use an example to write the first JavaScript program. It shows how JavaScript scripts are embedded in HTML documents.
test1.html Documents:
<Script Language ="JavaScript">
// JavaScript Appears here.
alert("这是第一个JavaScript例子!");
alert("欢迎你进入JavaScript世界!");
alert("今后我们将共同学习JavaScript知识!");
</Script>
</Head>
</Html>
The results of running rows in the Internet Explore5.0 are shown in Figure 1-1.
Figure 1-1 Results of the program running
Description: test.html is an HTML document, its identification format is standard HTML format;
Like the HTML markup Language, JavaScript code is the text that is browsed by some word processing software that appears in the HTML-related area of the description page.
JavaScript code consists of <script Language = "JavaScript" >...</Script> description. JavaScript scripts can be added between the identity <script Language = "JavaScript" >...</Script>.
Alert () is a JavaScript window object method that pops up a string with the OK dialog box and displays ().
Through the <!--...//--> identification Note: If you do not know the JavaScript code browser, all the tags in it are ignored, if you know, then execute its results. Using annotations This is a good programming habit that makes it possible for others to read your language.
JavaScript ends with a </Script> tag.
From the above example analysis, we can see that writing a JavaScript program is really very easy.