Thursday, October 7, 2010

The Basics of Java Script

Preliminary
JavaScript was first introduced by Netscape in 1995. At first the language is called "LiveScript" that serves as a simple language for the browser Netscape Navigator 2. In those days a lot of criticism of this language because it is less safe, which impressed the development rush rush and no error messages in the show every time we make a mistake when preparing a program. Then, in line with being jealous of cooperation between Netscape and Sun (the developer programming language "Java") at the time, then Netscape gave the name "JavaScript" to the language on 4 December 1995.

At the same time, Microsoft's own attempt to adapt this technology, which they called "JScript" in your Internet Explorer 3.


Javascript is a language that shaped a collection of scripts on the function running on an HTML document, the history of the Internet language is the first scripting language for the web. This language is a programming language to provide additional capability to the HTML language to allow execution of commands on the user side, which means in the browser rather than on the side of the web server.
Javascript is dependent on the browser (navigator) that calls a web page containing JavaScript scripts of course, tucked inside an HTML document.
Javascript also does not require special compiler or interpreter to run it (in fact JavaScript compiler itself is already included in the browser). As with the language "Java" (by which JavaScript is always on appeal compare) which require a special compiler to translate it on the user or client.


Needs Java Script
To learn Java Script programming, there are two necessary tools, namely:
• Text Editor
Used to write Java Script code, the text editor that can used, among others notepad and ultra edit.
• Web Browser
Used to display a web page that contains the codes Java Script. Web browser used must support Java Srcipt. Browsers that can be used are Internet Explorer and Netscape Navigator.


Writing Java Script
Java Script code is written in the file HTML.Terdapat two ways to write
Java Script code to display on an HTML page, namely:


Java script is written in the same file.
For writing in this way, the command used is
Language <script ="JavaScript"> java script program here </ SCRIPT>.
Commands are normally placed between the tags <BODY> ... </ BODY>


Writing Sample:

<HTML>
<HEAD> <TITLE> ... ... .... </ TITLE>
</ HEAD>
<BODY>
<script Language="JavaScript">
javascript code here
</ SCRIPT>
HTML code here
</ BODY>
</ HTML>

Javascript is written in a separate file JavaScript code can also we have made in a separate file in order to document HTML content was not too long. The attributes used are 
<script SRC="Filename.js"> ... </ SCRIPT> Among the tags <SCRIPT………> and <script> no longer needed code Javascriptnya because it was created in a file erpisah. Files that contain code Javascript extension.Js


First JavaScript Program
In this section we will make the program using JavaScript.
This program will display the text "Learning JavaScript Programming"



<HTML>
<BODY>
<script Language="JavaScript">
<!––
document.write ("Learning JavaScript Programming!");//––>
</ SCRIPT>
</ BODY>
</ HTML>

No comments:

Post a Comment