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++) { alert(i + &quot;) &quot; + sample_array[i]); } function sayHi(name) { alert(&quot;Hi, &quot;+ name); } sayHi(&quot;Binny&quot;);
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.
DOM document.getElementById(“id-of-element”) OR $()‏ document.getElementsByTagName(“a”)‏ document.getElementsByName(“name”)‏ Useful Functions getElementsByClassName(“external-links”)‏ getElementsBySelector(“p.intro a”)‏
Undervalued JavaScript is NOT a toy Ajax! High Profile Applications - like Gmail Has more use than validation
Underestimated Leader in client side scripting Bring Web Apps closer to the Desktop
JavaScript is a Powerful language First Class functions Map, Reduce functions $(&quot;element&quot;).addEventListener(&quot;click&quot;, function(){ alert(this.innerHTML + &quot; was clicked&quot;; });
First Class functions Function that returns a function function addXTo(x) { return function(number) { return number+x; } } addFiveTo = addXTo(5); addNineTo = addXTo(9); alert(addFiveTo(3));
Polymorphic Functions The functionality of functions can be changed... 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); }
Misunderstood JavaScript is NOT Java Its a functional language
Problems With JavaScript Design Errors Bad Implementations Browser wars
Solution to the Problem - Libraries Cross Browser Functionality You write less code Some operations are faster Better documentation than homebrew solutions etc.
JavaScript Libraries jQuery Prototype YUI Dojo ExtJS And many more...
JSL - JavaScript Library My Own JS Library http://www.openjs.com/scripts/jslibrary/

JavaScript: the most underestimated, undervalued and misunderstood language

  • 1.
    JavaScript: themost Underestimated, Undervalued and Misunderstood Language By Binny V A http://www.openjs.com/
  • 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.
    DOM – DocumentObject Model The Document Object Model (DOM) is a platform- and language-independent standard object model for representing HTML or XML and related formats.
  • 4.
    DOM document.getElementById(“id-of-element”) OR$()‏ document.getElementsByTagName(“a”)‏ document.getElementsByName(“name”)‏ Useful Functions getElementsByClassName(“external-links”)‏ getElementsBySelector(“p.intro a”)‏
  • 5.
    Undervalued JavaScript isNOT a toy Ajax! High Profile Applications - like Gmail Has more use than validation
  • 6.
    Underestimated Leader inclient side scripting Bring Web Apps closer to the Desktop
  • 7.
    JavaScript is aPowerful language First Class functions Map, Reduce functions $(&quot;element&quot;).addEventListener(&quot;click&quot;, function(){ alert(this.innerHTML + &quot; was clicked&quot;; });
  • 8.
    First Class functionsFunction that returns a function function addXTo(x) { return function(number) { return number+x; } } addFiveTo = addXTo(5); addNineTo = addXTo(9); alert(addFiveTo(3));
  • 9.
    Polymorphic Functions Thefunctionality of functions can be changed... 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.
    Misunderstood JavaScript isNOT Java Its a functional language
  • 11.
    Problems With JavaScriptDesign Errors Bad Implementations Browser wars
  • 12.
    Solution to theProblem - Libraries Cross Browser Functionality You write less code Some operations are faster Better documentation than homebrew solutions etc.
  • 13.
    JavaScript Libraries jQueryPrototype YUI Dojo ExtJS And many more...
  • 14.
    JSL - JavaScriptLibrary My Own JS Library http://www.openjs.com/scripts/jslibrary/