[X]

What is JavaScript - (Learning JavaScript Series)

The Javascript Language (File Extension .js)

Javascript is often confused with Java, but It has nothing to do with "Java Programming Language". It is a client side scripting language which supports object oriented, imperative and functional programming style. Javascript is mainly used in web pages and now a days it is implemented as part of web browsers (by default javascript is enabled in most of the browsers, but you can disable if you want). But it is not only restricted to web page and used in pdf documents and desktop widgets as well.

What is scripting language? "Scripting language is not compiled rather it is interpreted. VBScript and Perl are other scripting languages."

Javascript is most frequently used as cilent side validation on web pages. But it is also used in areas like

  • Google Adsense scripts are javascript, which are placed to show ads
  • Google Analytics, web site visitor tracking, is also javascript
  • Javascript is used in serving asynchronous content on web pages

History of Javascript

Javascript was originally developed for Netscape browser by Brendan Eich and was named as "Mocha" and made its first appearance in Netscape 2.0 in 1995, later it renamed to "LiveScript" and finally "JavaScript" as it is been claimed that the name is result of a co-marketing deal between "Netscape" and "Java". JavaScript was originally designed to help integrate HTML pages with "Java applets" - Java applications embedded in web pages. As of year 2011 javascript's current version is 1.8.5.

"JavaScript" is a trademark of "Oracle Corporation" and used under license for technology invented and implemented by "Netscape Communications" and current entities such as the "Mozilla Foundation".

"JavaScript" is officially managed by "Mozilla Foundation" and new language features are added from time to time. However some "Vendor Specific JavaScript" extensions also exist.

"JavaScript" supports much of the structured programming syntax from "C" langugage.

Cross browser compatibility

Though the main intent of the javascript was cross browser but with lots of browser in use and the difference in the version of javascript supported, an important part of testing and debugging is to test and verify that the JavaScript works across multiple browsers.

Development Tools

Javascript debuggers are available for Internet Explorer, Firefox, Safari, Google Chrome and Opera.

  • Internet Explorer 8 has in built debugger in form of developer tools which can be started by pressing F12 key.
  • Firefox provides and extension add-in name "Firebug" which can be used to debug web pages.
  • In Opera web pages can be debugged using a tool called "DragonFly".
  • In Safari and Google Chrome "Web Inspector" by WebKit is used for debugging.

Javascript Frameworks and other features

jQuery, ExtJs and Prototype are some of the most widely used javascript frameworks designed to simplify DOM oriented client side HTML scripting.

Sample javascript code:

Open notepad, create file with below text, and save it as "JavascriptTest.htm" file (Make sure while saving you have given file extension as .htm). Open the the page in any web browser and see the result.

 

<html>
  <head><title>Javascript test page</title></head>
  <body>
    <script type="text/javascript">
      document.write('Hello World!');
    </script>
    <noscript>
<p>Your browser either does not support JavaScript, it is turned off.</p>
    </noscript>
  </body>
</html>

 

 

 

JavaScript was (and still is) the only scripting language supported by all the major browser manufacturers. It is the only scripting language worth learning for client-side development. In the coming series of posts we will learn the basic and advanced concepts of javascript.

blog comments powered by Disqus

Posts By Month