Quick Upload

Loading...
Flash Player 9 (or above) is needed to view slideshows. We have detected that you do not have it on your computer.To install it, go here
Post to Twitter Post to Twitter
Share on Facebook
Myspace Hi5 Friendster Xanga LiveJournal Facebook Blogger Tagged Typepad Freewebs BlackPlanet gigya icons
« Prev Comments 1 - 10 of 15 Next »
  • step15
    step15 said 1 week Edit Delete

    Cool slideshow!!
    http://weapon.freemaker.net/

  • bernardes
    bernardes said 2 weeks Edit Delete

    André Bernardes
    Santos - SP - Brazil

    Know my Job:
    http://www.slideshare.net/bernardes/informaes-apresentvei...

    Know me:
    http://al-bernardes.sites.uol.com.br/

  • mcavikashtiwari
    mcavikashtiwari said 1 month Edit Delete

    hi

  • guestc22fdc
    guestc22fdc said 5 months Edit Delete

    Excellent overview!



    Regarding Slide #41, the Insertion class was deprecated in Prototype 1.6; the preferred method is to use the 'insert' method on elements.



    $('list').insert('default position: bottom, i.e. last child');



    Or the more complex version:



    $('list').insert({

    before: 'paragraph before',

    after: 'paragraph after',

    top: 'before first',

    bottom: 'last'

    });

  • guest06a3db
    guest06a3db said 7 months Edit Delete

    Pretty nice summary but there are a few issues...

    Slide 42's prototype example can be simplified as:

    $('div').observe('click ' , function() {
    alert('div clicked');
    });

    On slide 45 when comparing loading AJAX results to elements you can do this in one line with Prototype too:

    new Ajax.Updater('results', 'test.html');

    Also, when dealing with any AJAX request in Prototype you don't have to specify method: 'GET'... it's the default.

    Anyway, I've used all four libraries for varying projects... jQuery in Drupal, Prototype in my own framework and YUI/Dojo in an assortment of fun free time related things. I don't have an allegiance to any particular library I just thought someone might find this useful.

  • guest0ced3a
    guest0ced3a said 8 months Edit Delete

    Very good summary and appreciate it very much.

  • natekoechley
    natekoechley said 9 months Edit Delete

    For posterity I'll note that YUI has querying support (CSS syntax) now: http://developer.yahoo.com/yui/selector

    (updates slide #40)

    thanks for posting these. great stuff.

    Thanks,
    Nate
    YUI Team, Yahoo!.

  • natekoechley
    natekoechley said 9 months Edit Delete

    For posterity I'll note that YUI has querying support (CSS syntax) now: http://developer.yahoo.com/yui/selector



    (updates sllide #40)



    thanks for posting these. great stuff.



    Thanks,

    Nate

    YUI Team, Yahoo!.

  • oronm
    oronm said 10 months Edit Delete

    THANKS!! that was a great reading material

  • guestc87e63
    guestc87e63 said 11 months Edit Delete

    Awesome. Couldn't have been more helpful.

  • matthewsim
    matthewsim said 2 years Edit Delete

    John, thanks for posting this.

    In case anyone cares, here is the URL to recreate slide 15:
    http://www.google.com/trends?q=prototype+javascript%2C+jq...

  • jeresig
    jeresig said 2 years Edit Delete

    @handcoding: We've been talking about it - we'd like to get some support landed into jQuery UI (where it would be most appropriate). So, yes, we're thinking and talking about it!

  • handcoding
    handcoding said 2 years Edit Delete

    Are there any plans, by chance, for some accessibility / ARIA additions to jQuery? :)

  • jeresig
    jeresig said 2 years Edit Delete

    @guest Thanks! I've given this presentation a couple times now - but this one was a complete overhaul of the talks that I've done before. I'm pleased to see that the Ajax Experience people have asked me to give this talk 3 times now - I think that helps to speak to my attempted impartiality ;-)

  • guest8f3fda
    guest8f3fda said 2 years Edit Delete

    Impressive to see such an objective description from the lead developer of one of the projects. Thanks for a good presentation

Add a comment If you have a SlideShare account, login to comment; otherwise comment as a guest.

    JavaScript Library Overview

    from jeresig, 2 years ago Add as contact

    35559 views | 15 comments | 77 favorites | 64 embeds (Stats)

    Desc: JavaScript Library tutorial that I gave at the October 2007 Ajax Experience conference.

    Embed customize close
     

    More Info

    This slideshow is Public

    Views: 35559 Comments: 15 Favorites: 77 Downloads: 1657

    View Details: 33276 on Slideshare 2283 from embeds
    Most viewed embeds (Top 5): More
    All Embeds: Less
    Flagged as inappropriate Flag as inappropriate

    Flag as inappropriate

    Select your reason for flagging this slideshow as inappropriate.

    If needed, use the feedback form to let us know more details.

    Slideshow Transcript

    1. Slide 1: JavaScript Libraries Ajax Experience - October 2007 John Resig (ejohn.org)
    2. Slide 2: Question: How do you want to write JavaScript?
    3. Slide 3: 1) Plug-and-Play • Drop in a “calendar widget” or “tabbed navigation” • Little, to no, JavaScript experience required. • Just customize some options and go. • No flexibility.
    4. Slide 4: 2) Some Assembly Required • Write common utilities • Click a link, load a page via Ajax • Build a dynamic menu • Creating interactive forms • Use pre-made code to distance yourself from browser bugs. • Flexible, until you hit a browser bug.
    5. Slide 5: 3) Down-and-Dirty • Write all JavaScript code from scratch • Deal, directly, with browser bugs • Quirksmode is your lifeline • Excessively flexible, to the point of hinderance.
    6. Slide 6: What we’ve just seen... • Widgets • Libraries • Raw JavaScript
    7. Slide 7: What we’ve just seen... • Widgets • Libraries • Raw JavaScript
    8. Slide 8: Why use a library? • Makes JavaScript bearable • Gets the job done fast • Simplifies cross-browser support • Sort of like C stdlib - no one just codes all of C by hand
    9. Slide 9: What kind of libraries exist? Open Source Commercial Atlas Client/ AjaxCFC Backbase for Server Qcodo Struts Prototype Browser jQuery Backbase Only Yahoo UI SmartClient Dojo
    10. Slide 10: What kind of libraries exist? Open Source Commercial Atlas Client/ AjaxCFC Backbase for Server Qcodo Struts Prototype Browser jQuery Backbase Only Yahoo UI SmartClient Dojo
    11. Slide 11: Open Source Libraries Browser Only Client/Server Scriptaculous Task AjaxCFC moo.fx Specific Qcodo Open Rico Prototype General jQuery Ruby on Rails Purpose Yahoo UI CakePHP Dojo
    12. Slide 12: Open Source Libraries Browser Only Client/Server Scriptaculous Task AjaxCFC moo.fx Specific Qcodo Open Rico Prototype General jQuery Ruby on Rails Purpose Yahoo UI CakePHP Dojo
    13. Slide 13: Why these libraries?
    14. Slide 14: Ajaxian Survey Prototype jQuery Yahoo UI Dojo 20% 35% 21% 25% http://ajaxian.com/archives/ajaxian-2007-survey-results
    15. Slide 15: Google Trends Prototype jQuery Dojo Yahoo UI http://google.com/trends?q=prototype+javascript%2C+jquery+javascript%2C+yui+javascript%2C+dojo+javascript&ctab=0&geo=all&date=all&sort=0
    16. Slide 16: The Libraries
    17. Slide 17: Prototype
    18. Slide 18: Prototype: Overview • Started early 2005 by Sam Stephenson • Incredibly popular, tied with Ruby on Rails’ popularity • Development backed by 37 Signals
    19. Slide 19: Prototype: Focus • Improving the usability of the JavaScript language • Big emphasis on adding in ‘missing’ JavaScript features • Clean structure, clean objects and ‘classes’
    20. Slide 20: Prototype: Details • Code quality is fantastic, great features • All animations (and interactions) are in Scriptaculous • Updated frequently • Looking at Prototype 1.6.0
    21. Slide 21: jQuery
    22. Slide 22: jQuery: Overview • Released January 2006 by John Resig • Rapid rise in popularity • Many developers across the globe
    23. Slide 23: jQuery: Focus • Improving the interaction between JavaScript and HTML • Finding elements then performing actions • Highly-effective, short, code
    24. Slide 24: jQuery: Details • Core features are limited to DOM, Events, Effects, Ajax • Other features can be added in via plugins • Looking at jQuery 1.2.1
    25. Slide 25: Yahoo! UI
    26. Slide 26: YUI: Overview • Released Feb 2006 by Yahoo! • Maintained and financed internally • Attempt to standardize internal JavaScript
    27. Slide 27: YUI: Focus • Exposing, and solving, common methodologies • Looking for common idioms (Drag-and- Drop, Calendar, Auto-Complete) • Looking at Yahoo UI 2.3.1
    28. Slide 28: Dojo
    29. Slide 29: Dojo: Overview • Started early 2005 by Alex Russell + Co. • Large development community • Lots of corporate backing (IBM, AOL) • Big code base, tons of features
    30. Slide 30: Dojo: Focus • Building complete web applications • A package heirarchy, e.g.: dojo.addClass( ... ) • Focus has transcended into widgets (Dijit) • Huge number of features • Today we’re looking at Dojo 0.9
    31. Slide 31: What should a library have?
    32. Slide 32: Code Base • Core Functionality • DOM • Events • Ajax • Animations • User Interface Widgets
    33. Slide 33: Development • Good Architecture • Open Licensing • Wide Browser Support • Small File Size
    34. Slide 34: Project • Development Team (Open, Funded) • Code in SVN / Bug Tracker • Good Unit Test Coverage
    35. Slide 35: Documentation • Full API Coverage • Plenty of Tutorials • Some Books • Wide variety of Demos
    36. Slide 36: Community • Active Mailing List / Forum • Support and Training • Popularity
    37. Slide 37: Code Base • Core Functionality • DOM • Events • Ajax • Animations • User Interface Widgets
    38. Slide 38: Core Functionality • Bare minimum needed to make a dynamic “Ajax” web site: • DOM (Traversal and Manipulation) • Events • Ajax • Animations
    39. Slide 39: DOM • Traversal • Using CSS selectors to locate elements • Modification • Create/remove/modify elements • Having a DOM builder is important
    40. Slide 40: DOM Traversal • Prototype: $$(“table > tr”) • jQuery: $(“div > p:nth-child(odd)”) • Dojo: dojo.query(“table tr:nth-child(even)”) • Yahoo UI: No querying support
    41. Slide 41: DOM Modification • Prototype: Insertion.Bottom(“list”,”<li>Another item</li>”); • jQuery: $(“#li”).append(“<li>An item</li>”); • Dojo and Yahoo UI have weak support - no DOM building capabilities, basic property modification
    42. Slide 42: Events • Support for simple event binding/removal • Support for custom events is essential • Prototype: Event.observe(“button”,”click”, function(){ alert(“Thanks for the click!”); }); • jQuery: $(“div”).click(function(){ alert(“div clicked”); });
    43. Slide 43: Events (cont.) • Yahoo UI: YAHOO.util.Event.addEventListener(“list”, “click”, function(){ alert(“List Clicked”); }); • Dojo: dojo.connect(dojo.byId(\"mylink\"), \"click\", function(){ alert(“Link clicked”); });
    44. Slide 44: Custom Events • $(“#list”).bind(“drag”, function(){ $(this).addClass(“dragged”); }); • $(“#test”).trigger(“drag”);
    45. Slide 45: Ajax • Request and load remote documents • Prototype: new Ajax.Request(“test.html”, { method: “GET”, onComplete: function(res){ $(‘results’).innerHTML = res.responseText; } }); • jQuery: $(“#results”).load(“test.html”);
    46. Slide 46: Ajax (cont.) • Yahoo UI YAHOO.util.Connect.asyncRequest( 'GET', “test.html”, function(data){ YAHOO.util.Dom.id(“results”).innerHTML = data; } ); • Dojo dojo.io.bind({ url: \"test.html\", method: \"get\", mimetype: \"text/html\", load: function(type, data) { dojo.byId(“results”).innerHTML = data; } });
    47. Slide 47: Ajax (cont.) • jQuery is only one capable of doing DOM traversing over XML • jQuery.get(“test.xml”, function(xml){ $(“user”, xml).each(function(){ $(“<li/>”).text( $(this).text() ) .appendTo(“#userlist”); }); });
    48. Slide 48: Animations • Simple animations (hide/show/toggle) • Provide elegant transitions • No animations in Prototype Core (see Scriptaculous, instead) • jQuery: $(“#menu”).slideDown(“slow”);
    49. Slide 49: Animations (cont.) • Yahoo UI: new YAHOO.util.Anim(“list”, { width: { from: 10, to: 100 } }, 1, YAHOO.util.Easing.easeOut ); • Dojo: dojo.fadeOut({ node: dojo.byId(“list”), duration: 500 });
    50. Slide 50: Core Feature Summary DOM Events Anim. Ajax Prototype X X - X jQuery X X X X Yahoo UI / X X X Dojo / X X X
    51. Slide 51: User Interface Widgets • ejohn.org <-- slides • Difficult to implement components, made easy • Commonly used, save duplication • Some common components: Drag & Drop, Tree, Grid, Modal Dialog, Tabbed Pane, Menu / Toolbar, Datepicker, Slider
    52. Slide 52: User Interface Packages • Only looking at officially-supported code: • Prototype has Scriptaculous • jQuery has jQuery UI • Dojo has Dijit • Included in Yahoo UI
    53. Slide 53: Drag & Drop • Drag an item from one location and drop in an other • Supported by all libraries
    54. Slide 54: Tree • A navigable hierarchy (like a folder/file explorer) • In Dojo and Yahoo UI
    55. Slide 55: Grid • An advanced table (resizable, editable, easily navigable) • In Dojo and Yahoo UI
    56. Slide 56: Modal Dialog • Display confined content (usually drag & droppable) and confirmation dialogs • In Dojo,Yahoo UI, and jQuery
    57. Slide 57: Tabbed Pane • Multiple panes of content navigable by a series of tabs • In Dojo,Yahoo UI, and jQuery
    58. Slide 58: Menu / Toolbar • A list of navigable items (with sub-menus) • In Dojo and Yahoo UI
    59. Slide 59: Datepicker • An input for selecting a date (or a range of dates) • In Dojo,Yahoo UI, and jQuery
    60. Slide 60: Slider • A draggable input for entering a general, numerical, value • In all libraries
    61. Slide 61: Tons More! • Color Picker (Dojo,YUI) • Layout (Dojo,YUI) • Auto Complete (Dojo, Proto,YUI) • Selectables (Proto, jQuery) • Accordion (Dojo, jQuery) • WYSIWYG (Dojo,YUI)
    62. Slide 62: Themeing • A consistent look-and-feel for widgets • jQuery,Yahoo UI, and Dojo provide themeing capabilities • jQuery’s and Yahoo UI’s are documented
    63. Slide 63: Accessibility • Taking in to consideration points from ARIA (Accessible Rich Internet Applications) • Dojo is taking a solid lead, here
    64. Slide 64: Development • Good Architecture • Open Licensing • Wide Browser Support • Small File Size
    65. Slide 65: Architecture • Bottom Up (Prototype, jQuery) vs. Top Down (Dojo,Yahoo UI) • jQuery, Dojo, and Yahoo UI all use a single namespace • Prototype extends native objects (high likelihood of inter-library conflict) • jQuery is extensible with plugins
    66. Slide 66: Licensing • All use liberal licenses (“Keep my name on the file, don’t sue me.”) • MIT: Prototype, jQuery • BSD: Yahoo UI, Dojo
    67. Slide 67: Browser Support • Everyone supports: IE 6+, Firefox 2+, Safari 2+, Opera 9+ • Except: • Prototype doesn’t support Opera • Dojo is dropping support for Safari 2
    68. Slide 68: File Size • Serving your JavaScript minified + Gzipped • Optimal level of compression and speed • Core file size (in KB): 35.00 26.25 17.50 8.75 0 Prototype jQuery Yahoo UI Dojo
    69. Slide 69: Project • Development Team (Open, Funded) • Code in SVN / Bug Tracker • Good Unit Test Coverage
    70. Slide 70: Development Team • Prototype, jQuery, and Dojo all have open development (anyone can contribute) • jQuery,Yahoo UI, and Dojo all have paid, full-time, developers working on the code • All have paid, part-time, developers
    71. Slide 71: SVN / Bug Tracker • Prototype, jQuery, and Dojo all have code in a public SVN repositor • Yahoo UI’s development is private and is limited to Yahoo employees • All libraries have a public bug tracker
    72. Slide 72: Unit Tests • All libraries have some automated unit tests • jQuery,Yahoo UI, and Dojo all have public unit tests • jQuery and Dojo have tests that can run in Rhino
    73. Slide 73: Documentation • Full API Coverage • Plenty of Tutorials • Some Books • Wide variety of Demos
    74. Slide 74: API Documentation • Prototype, jQuery, and Yahoo UI all have full coverage • jQuery provides runnable examples with each API item • Dojo’s coverage is spotty - work in progress
    75. Slide 75: Tutorials • All libraries provide some tutorials • jQuery and Yahoo UI have screencasts • Prototype: 6 • jQuery: 68 (English) • Yahoo UI: 32 • Dojo: 5
    76. Slide 76: Books • Prototype: • Prototype and Scriptaculous in Action (Manning) • Prototype and Scriptaculous (Pragmatic) • jQuery: • Learning jQuery (Packt) • jQuery Reference Guide (Packt) • Yahoo UI: None • Dojo: A short online book
    77. Slide 77: Demos • Yahoo UI provides a considerable number of live demos and examples for all features • jQuery provides live examples and a few demo applications • Dojo provides demo applications for their widgets
    78. Slide 78: Community • Active Mailing List / Forum • Support and Training • Popularity
    79. Slide 79: Mailing List / Forum • Prototype, jQuery, and Yahoo UI have mailing lists • Prototype: 23 posts/day • jQuery: 108 posts/day • Yahoo UI: 36 posts/day • Dojo has an active forum
    80. Slide 80: Support and Training • Dojo provides paid support and training (via Sitepen)
    81. Slide 81: Popularity • Who uses what: • Prototype: Apple, ESPN, CNN, Fox News • jQuery: Google, Amazon, Digg, NBC, Intel • Yahoo:Yahoo, LinkedIn, Target, Slashdot • Dojo: IBM, AOL, Mapquest, Bloglines
    82. Slide 82: More Information • Prototype: http://prototypejs.org/ • jQuery: http://jquery.com/ • Yahoo UI: http://developer.yahoo.com/yui/ • Dojo: http://dojotoolkit.org/
    83. Slide 83: Ajax Experience Presentations • Presentations on: • Dojo (2) • Prototype (2) & Scriptaculous (1) • jQuery (3) • Go to one that sounds interesting and enjoy!