JavaScript:  the most Underestimated,  Undervalued  and Misunderstood Language By Binny V A http://www.openjs.com/
You KNOW JavaScript! var sample_array = [42, 1337, &quot;Hello World&quot;]; for(var i=0; i<sample_array.length; i++) { al...
DOM – Document Object Model The Document Object Model (DOM) is a platform- and language-independent standard object model ...
DOM <ul><li>document.getElementById(“id-of-element”) OR $()‏ </li></ul><ul><li>document.getElementsByTagName(“a”)‏ </li></...
Undervalued <ul><li>JavaScript is NOT a toy </li></ul><ul><li>Ajax! </li></ul><ul><li>High Profile Applications - like Gma...
Underestimated <ul><li>Leader in client side scripting </li></ul><ul><li>Bring Web Apps closer to the Desktop </li></ul>
JavaScript is a Powerful language <ul><li>First Class functions </li></ul><ul><ul><li>Map, Reduce functions </li></ul></ul...
First Class functions <ul><li>Function that returns a function </li></ul>function addXTo(x) { return function(number) { re...
Polymorphic Functions <ul><li>The functionality of functions can be changed... </li></ul>function addEvent(obj,evt,fn) { i...
Misunderstood <ul><li>JavaScript is NOT Java </li></ul><ul><li>Its a functional language </li></ul>
Problems With JavaScript <ul><li>Design Errors </li></ul><ul><li>Bad Implementations </li></ul><ul><li>Browser wars </li><...
Solution to the Problem - Libraries <ul><li>Cross Browser Functionality </li></ul><ul><li>You write less code </li></ul><u...
JavaScript Libraries <ul><li>jQuery </li></ul><ul><li>Prototype </li></ul><ul><li>YUI </li></ul><ul><li>Dojo </li></ul><ul...
JSL - JavaScript Library <ul><li>My Own JS Library </li></ul><ul><li>http://www.openjs.com/scripts/jslibrary/ </li></ul>
Upcoming SlideShare
Loading in …5
×

JavaScript: the most underestimated, undervalued and misunderstood language

6,637 views

Published on

An introduction to the power of javascript.

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
6,637
On SlideShare
0
From Embeds
0
Number of Embeds
735
Actions
Shares
0
Downloads
97
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

JavaScript: the most underestimated, undervalued and misunderstood language

  1. 1. JavaScript: the most Underestimated, Undervalued and Misunderstood Language By Binny V A http://www.openjs.com/
  2. 2. You KNOW JavaScript! var sample_array = [42, 1337, &quot;Hello World&quot;]; for(var i=0; i<sample_array.length; i++) { alert(i + &quot;) &quot; + sample_array[i]); } function sayHi(name) { alert(&quot;Hi, &quot;+ name); } sayHi(&quot;Binny&quot;);
  3. 3. DOM – Document Object Model The Document Object Model (DOM) is a platform- and language-independent standard object model for representing HTML or XML and related formats.
  4. 4. DOM <ul><li>document.getElementById(“id-of-element”) OR $()‏ </li></ul><ul><li>document.getElementsByTagName(“a”)‏ </li></ul><ul><li>document.getElementsByName(“name”)‏ </li></ul>Useful Functions getElementsByClassName(“external-links”)‏ getElementsBySelector(“p.intro a”)‏
  5. 5. Undervalued <ul><li>JavaScript is NOT a toy </li></ul><ul><li>Ajax! </li></ul><ul><li>High Profile Applications - like Gmail </li></ul><ul><li>Has more use than validation </li></ul>
  6. 6. Underestimated <ul><li>Leader in client side scripting </li></ul><ul><li>Bring Web Apps closer to the Desktop </li></ul>
  7. 7. JavaScript is a Powerful language <ul><li>First Class functions </li></ul><ul><ul><li>Map, Reduce functions </li></ul></ul>$(&quot;element&quot;).addEventListener(&quot;click&quot;, function(){ alert(this.innerHTML + &quot; was clicked&quot;; });
  8. 8. First Class functions <ul><li>Function that returns a function </li></ul>function addXTo(x) { return function(number) { return number+x; } } addFiveTo = addXTo(5); addNineTo = addXTo(9); alert(addFiveTo(3));
  9. 9. Polymorphic Functions <ul><li>The functionality of functions can be changed... </li></ul>function addEvent(obj,evt,fn) { if (document.addEventListener) { addEvent = function (obj,evt,fn) { obj.addEventListener(evt,fn,false); } } else if (document.attachEvent) { addEvent = function (obj,evt,fn) { obj.attachEvent('on'+evt,fn); } } addEvent(obj,evt,fn); }
  10. 10. Misunderstood <ul><li>JavaScript is NOT Java </li></ul><ul><li>Its a functional language </li></ul>
  11. 11. Problems With JavaScript <ul><li>Design Errors </li></ul><ul><li>Bad Implementations </li></ul><ul><li>Browser wars </li></ul>
  12. 12. Solution to the Problem - Libraries <ul><li>Cross Browser Functionality </li></ul><ul><li>You write less code </li></ul><ul><li>Some operations are faster </li></ul><ul><li>Better documentation than homebrew solutions </li></ul><ul><li>etc. </li></ul>
  13. 13. JavaScript Libraries <ul><li>jQuery </li></ul><ul><li>Prototype </li></ul><ul><li>YUI </li></ul><ul><li>Dojo </li></ul><ul><li>ExtJS </li></ul><ul><li>And many more... </li></ul>
  14. 14. JSL - JavaScript Library <ul><li>My Own JS Library </li></ul><ul><li>http://www.openjs.com/scripts/jslibrary/ </li></ul>

×