Introducing JavaScript.

By: aathishankaran Viewed: 177 times  Printer Friendly Format    


JavaScript is a new technology even newer than Java itself. Netscape initially developed JavaScript under the name of LiveScript. This scripting language was intended to extend the capabilities of basic HTML and provide an alternative to using CGI scripts. After Java's popularity, Netscape followed the notation of Java - hence, the name change to JavaScript. 

Features of JavaScript

JavaScript Is Embedded into HTML.

If you deal with JavaScript, there is hardly any separation of the two. JavaScript code is usually housed within HTML documents and executed within them. Additionally, by itself, JavaScript has no user interface; it relies on HTML to provide its means of interaction with the user. 

JavaScript uses HTML as a means of jumping into the Web application framework.

It also extends the normal capabilities of HTML by providing events to HTML tags and allowing event-driven code to execute within it. 

EXAMPLE for JavaScript embedded in an HTML file. 

<html>

<head>

<title>Status Bar</title> .

<SCRIPT LANGUAGE="JavaScript">

<!- window.defaultStatus= "Welcometo the large URL page." .

function changeStatus()

{

window. status = "Click me to go to the Acadia Software home page." }

function changeDefaul tSta tus () { window. defaul tSta tus =

window.document.statusForm.messageList.

options[window.document.statusForm.messageList. selectedlndex].text

} //--> </SCRIPT> </head>

<body> <p align=center> <font

color="#OO8040"> <font size=7> <strong>http://www.java-samples.com</

strong></font></font></p> <p.,align=center> <a href="http: //

www.java-samples.com" onMouseOver="changeStatus() ireturn true">Go...</

a/p>

<form name="statusForm" method="POST">

<p>

<br>

<br>

<br>

<br>

</p>

<p align=center>

<font size=1> 

To change the default status bar message, select a message from the list below and click the Change button.

 </font>

</p>

<p align=center>

<select name=lmessageList" size=l>

<option selected>Welcome to the large URL page.</option>

<option>On route to Acadia Software</option>

<option>This page intentionally left (nearly) blank.</option>

<option>An exciting example of changing status bar text.</option>

</select>

<input type=button

onClick=ā€¯changeDefaultStatus()ā€¯>

</p>

</form>

</body>

</html>



Most Viewed Articles (in Java )

Latest Articles (in Java)

Comment on this tutorial