Slideshow transcript
Slide 1: JavaScript: the most Underestimated, Undervalued and Misunderstood Language By Binny V A http://www.openjs.com/
Slide 2: You KNOW JavaScript! var sample_array = [42, 1337, "Hello World"]; for(var i=0; i<sample_array.length; i++) { alert(i + ") " + sample_array[i]); } function sayHi(name) { alert("Hi, "+ name); } sayHi("Binny");
Slide 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.
Slide 4: DOM document.getElementById(“id-of-element”) OR $() document.getElementsByTagName(“a”) document.getElementsByName(“name”) Useful Functions getElementsByClassName(“external-links”) getElementsBySelector(“p.intro a”)
Slide 5: Undervalued JavaScript is NOT a toy Ajax! High Profile Applications - like Gmail Has more use than validation
Slide 6: Underestimated Leader in client side scripting Bring Web Apps closer to the Desktop
Slide 7: JavaScript is a Powerful language First Class functions Map, Reduce functions $("element").addEventListener("click", function(){ alert(this.innerHTML + " was clicked"; });
Slide 8: 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));
Slide 9: 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); }
Slide 10: Misunderstood JavaScript is NOT Java Its a functional language
Slide 11: Problems With JavaScript Design Errors Bad Implementations Browser wars
Slide 12: Solution to the Problem - Libraries Cross Browser Functionality You write less code Some operations are faster Better documentation than homebrew solutions etc.
Slide 13: JavaScript Libraries jQuery Prototype YUI Dojo ExtJS And many more...
Slide 14: JSL - JavaScript Library My Own JS Library http://www.openjs.com/scripts/jslibrary/



Add a comment on Slide 1
If you have a SlideShare account, login to comment; else you can comment as a guest- Favorites & Groups
Showing 1-50 of 3 (more)