Thursday, February 16, 2012

What is JavaScript


 
Most of the people routinely face with the term Java, and they often ask what is JavaScript

Here is the answer; Java Script is an open, easily learned scripting language that was created by Sun and Netscape to be used with Netscape Navigator 2.0. Designed to unite the charge superpower of HTML and Java, Java script (originally called Live Script) was designed to complement HTML and Java and to seamlessly integrate with both.

Developing applets lies largely in the realm of professional programmer but creating HTML pages with JavaScript can be fearlessly undertaken by mere mortals. By adding JavaScript to a Web page, you can control the interaction and behavior of your page. Since JavaScript delegates’ simple tasks to the browser, it keeps the action at the local level and thereby reduces network traffic. The bonus involved in this setup is that your response times are quicker.

JavaScript mimics much of Java’s syntax, but it’s an interpreter, not compiled, language (Java, on the other hand, must be compiled before it runs).
When your browser downloads HTML text, the JavaScript application code comes along with it and the downloaded with the HTML as text into the browser. The browser the executes the code, which can contain simple applications.
Authoring with JavaScript
If you’re trying to learn JavaScript (or java, for that matter), viewing the source is an excellent place to begin. 

Here’s a simple example of a JavaScript

<html>
<head>
<TITLE>My first JavaScript</TITLE>
<SCRIPT LANGUAGE=*JavaScript”>
<!-
Document.write(*This text appears before the body of the HTML page.<P>”);
// --à
</SCRIPT>
</HEAD>
<BODY>
<H3> Hoyden’s first Java Web page </H3>
</BODY>
</HTML>
The tags that alert the browser that this file contains JavaScript code are
<SCRIPT>….</SCRIPT>

You can insert JavaScript code between these two tags for the browser to recognize, and run.
Since, at the time of writing, JavaScript lacks a debugger; its programs give you error messages when they spot misdates (which are common). Practice is the key to effectively debugging JavaScript programs. The error messages will seem common after a while, and you’ll be able to figure out where the bugs are burrowing.

Although some privacy problems plagued JavaScript when used in conjunction with Netscape Navigator 2.0, the release of 2.01 addressed these problems. JavaScript cannot be used be used to invoke Java applets, and for that reason, the privacy problems reported with JavaScript don’t exist in Java applets.

1 comments:

Md. Abdul Monim said...

Java script is useful to web but takes a little more resource from both user and server end.

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More