Quickly – here’s the slides from the JavaScript Library Overview tutorial that I gave today at the Ajax Experience conference.
This was a detail-heavy talk, please let me know if you have any questions about the libraries, I’ll attempt to clarify them as best as I can.
Jon (October 24, 2007 at 3:34 am)
Just curious as to why extjs not mentioned in your presentation?
Crayon (October 24, 2007 at 3:38 am)
Thanks !
Joao (October 24, 2007 at 4:35 am)
Very nice. Thanks.
Mary (October 24, 2007 at 6:39 am)
how do you download this?
John Resig (October 24, 2007 at 7:35 am)
@Jon: These are the four most popular libraries – by a long, long, stretch. They’ve been around longer, they have more users, and more people have used them. If you were to mention them in a job posting, you would be able to find people who’ve used them before.
@Mary: You can download the slides off of the slideshare site, here: http://www.slideshare.net/jeresig/javascript-library-overview/download
Marc (October 24, 2007 at 10:05 am)
I wrote a few notes on this presentation and the other tutorial sessions at the Ajax Experience here:
http://marcgrabanski.com/article/79/Ajax-Experience-Tutorial-Sessions
Peter Michaux (October 24, 2007 at 11:41 am)
Slide 20:
“Prototype: Details. Code quality is fantasitic…”
Slide 67:
“Prototype doesn’t support Opera.”
I cannot see how the first judgment can be made if the second statement is true.
John Resig (October 24, 2007 at 11:46 am)
@Peter: They, currently, don’t support Opera – however they are working to add support (and should have it in for Prototype 1.6.0, as I understand it).
That being said, I was discussing code quality as being separate from any sort of functionality (the design and implementation of the code both looks appealing and is easy to follow).
kangax (October 24, 2007 at 12:19 pm)
John, thanks for a great overview!
Prototype indeed lacks down-to-earth tutorials that’s why I recently started writing about common practices and tips using prototype. Hopefully this will give some insight as to to how to do things using this library.
Thanks for all the contribution.
John Resig (October 24, 2007 at 1:32 pm)
@kangax: Great work – you should talk with the Prototype team about getting them onto their web site (or, at least, getting them linked to). This way users going to the source (prototypejs.org) can easily find it.
Joao (October 24, 2007 at 2:01 pm)
I’m just reading this:
http://mislav.caboo.se/js/upgrading-to-prototype-1-6-real-world-examples/
And having just started using Prototype 1.6 rc1 for the past couple of days myself, I really like it even though I barely know it enough yet. I’ve integrated it with my own library, offloading as much as I can to Prototype, like Ajax, Events, and even Classes.
While it does not provide everything out of the box and has some compatibility problems like the aforementioned Opera one, I wonder whether someone else could create an end-user library like jQuery on top of it so we could just build up from the same toolset? :-)
Neil Roberts (October 25, 2007 at 8:31 am)
For what it’s worth, it looks like some of your Dojo examples use the 0.9 API and some use the old 0.4 API.
John Resig (October 25, 2007 at 3:10 pm)
@Neil – do you know which use which? I was just going off of the online documentation for 0.9, so I honestly don’t know which ones are current or not.
Neil Roberts (October 26, 2007 at 7:34 am)
DOM Modification:
dojo.query("#li").addContent("<li>An item</li>");
Events: Your snippet is right, but also:
dojo.query("div").click(function(){ alert("div clicked"); });
AJAX:
dojo.xhrGet({ url: "test.html", load(data){ /* function content is correct */ }});
Animations: Once again, there’s support for query syntax.
John Resig (October 26, 2007 at 9:52 am)
@Neil: Very interesting – you can definitely see where the inspiration is coming from, here ;-)
I think I missed the documentation on this – is it located on the main site?
James Burke (October 26, 2007 at 11:28 am)
I see jQuery as the first best example on how to offer DOM querying with chainable method calls. Very nice work.
About the list of chainable methods related to dojo.query: the methods are actually defined on the dojo.NodeList object (the object returned from a dojo.query() call), and not part of the main dojo.query method. Unfortunately, a discussion of NodeList seems to be missing from the Dojo Book. I’ll ask the doc folks about filling in that gap.
If you want a bullet list of the methods, you can see this blog post that runs down all the functionality in the core dojo.js file:
http://dojotoolkit.org/2007/08/22/dissecting-0-9s-dojo-js
There is a NodeList section near the bottom of the post.
John Resig (October 26, 2007 at 11:24 pm)
Thanks James and Neil! I’ll be sure to update my presentation.
Fred Oliveira (October 27, 2007 at 12:07 pm)
Great presentation. I’ve been using Prototype for a very long time now but have been dabbling in jQuery recently. It always struck me as a little better because it is both lighter in terms of footprint and doesn’t conflict with other codebases (which is important in a project I’m migrating) – and because I was sold on your techtalk.
I’m also somewhat curious about moo because those guys do a really good job at showing their library’s potential through demos – which is something I always wished jQuery had a better showcase of. Not that it makes a huge difference for people who are already somewhat proficient with Javascript, but it does help “sell” it to designers, etc.
Neil Roberts (November 2, 2007 at 7:14 am)
John, the API for dojo.NodeList is here: http://redesign.dojotoolkit.org/?q=jsdoc/dojo/HEAD/object/dojo.NodeList
Andrew Dupont (November 8, 2007 at 1:16 pm)
Prototype has public unit tests. They’re available in SVN. We take them very seriously — all patches must have tests before they get accepted.
We need to do a better job of explaining browser support on our website, but we informally divide browsers into two tiers, much like Yahoo’s A-grade and C-grade browser support. In that sense, Prototype treats Opera as a C-grade browser — any showstoppers get fixed, and we happily accept patches to increase Opera compatibility, but we don’t require that every single unit test pass in Opera (as we do for all A-grade browsers) before we release a final version. Opera is one of the included browsers in our automated testing (“rake test” from the command line).
And now that 1.6 is final I’ll expect you to update your code examples! ;-)