JavaScript_A Beginner's Guide - Introduction to JavaScript - 09/19/2012

来源:互联网 发布:数控加工及编程题库 编辑:程序博客网 时间:2024/05/17 03:04

 Of course, you can build a Web page by using only HTML, but JavaScript allows you to add additional features that a static page of HTML can’t provide without some sort of scripting or programming help.

JScript is the version of JavaScript that Microsoft Internet Explorer uses (which has additional features because it is implemented as a Windows Script engine; it can use server  side languages to perform more complex tasks like updating databases).

ECMAScript is the international standard name and specification for the JavaScript language, so it’s not a new language but a standard that is set for JavaScript and JScript

JavaScript and Java are two different languages. Java is a full programming language that must be compiled (running a program through software that converts the higher-level code to machine language) before a program (often called a Java applet) can be executed. Java is more powerful but also more complex.JavaScript is an object-based, client-side scripting language that you can use to make Web pages more dynamic. 

Object based means that JavaScript can use items called objects. However, the objects are not class based (meaning no distinction is made between a class and an instance); instead, they are just general objects.

Client side means that JavaScript runs in the client (software) that the viewer is using, rather than on the Web server of the site serving the page. In this case, the client would be a Web browser. With a client-side language, the browser reads and interprets the code, and the results can be given to the viewer without getting information from the server first. This process can make certain tasks run more quickly

JavaScript can also be used to check the information entered into a form before the form is sent to a server-side program to be processed. This information check can prevent strain on the Web server by preventing submissions with inaccurate or incomplete information. Rather than running the program on the server until the information is correct, that data can be sent to the server just once with correct information.

A scripting language doesn’t require a program to be compiled before it is run. All the interpretation is done on-the-fly by the client.

JavaScript runs in the browser by being added into an existing HTML document (either directly or by referring to an external script file). You can add special tags and commands to the HTML code that will tell the browser that it needs to run a script. Once the browser sees these special tags, it interprets the JavaScript commands and will do what you have directed it to do with your code. Thus, by simply editing an HTML document, you can begin using JavaScript on your Web pages and see the results.

To find additional information online to help you with JavaScript, here are some useful resources:
● A place to find tutorials with working examples of the results: www.pageresource.com/jscript
● An excellent tutorial site that includes cut-and-paste scripts: www.javascriptkit.com

● Video series:  http://channel9.msdn.com/Series/Javascript-Fundamentals-Development-for-Absolute-Beginners

 

First JavaScript program

<html> <body> <script type="text/javascript">   document.write("This text was written with JavaScript!"); </script> </body></html>

 

 

 

原创粉丝点击