Dojo vs JQuery, Part 1
Thursday, January 8th, 2009Although I had created a few code snippets using Scriptaculous/Prototype, Dojo Toolkit was the first Javascript Framework that I really learned. I had read about (and downloaded) it quite a few years before I actually used it. I purchased a couple of books (Mastering Dojo: JavaScript and Ajax Tools for Great Web Experiences (Pragmatic Programmers) and Dojo: The Definitive Guide
) to help me get started. I was working on a project where web pages would be dynamically created. I have to admit, I struggled. Although Dojo is a “Javascript” Framework, learning it was like learning a new language – before the discovery of the Rosetta Stone. While I was able to learn the basics from reading the books and looking at the examples on Dojo’s website, in many cases, I just could not find the documentation to do what I wanted to do (or how I wanted to do it). So I guessed. And guessed again. And continually guessed until, “Eureka!”. No that didn’t work either…
Remember in the early days of Javascript before a tool like Firebug existed, you would get an error or your code didn’t work and you would have no idea why or how to fix it. When I first began working with Dojo, I felt as if I were starting over. I was a Delphi developer for many years and so I was used to robust debugging and documentation. Although, Firebug handles the debugging, some of the cryptic messages that are displayed from Dojo Toolkit are nearly impossible to figure out (reminded me of some the javascript error messages that were displayed in IE quite a few years ago). And even when I understood what caused the error, I had a difficult time finding any documentation on how to fix it.
Then along came JQuery. I had taken over an Ajax-enabled project that was started by another developer who used JQuery here and there throughout the website. I had heard of JQuery, but I didn’t really know anything about it. I was immediately impressed with what I was able to do. In my opinion, JQuery is a purer “Javascript” Framework – I did not have to learn another language. The JQuery Library extends Javascript by providing “shortcuts” to writing Javascript. While the Dojo Toolkit also offers some of the same shortcuts, it is an animal all to it’s own. In my opinion, JQuery is just an extension of a scripting language (Javascript is a scripting language, not a programming language) while Dojo is becoming an operating system – without providing the necessary documentation.
While I do think that Dojo is must more robust than JQuery (and I will use Dojo to create other websites in the future), I also know that, at this point, I can create Ajax-enabled websites much faster using JQuery. On the other hand, Dojo (as well as YUI) is closer than most open-source Javascript Frameworks to ensuring that the browser will be only operating system needed. What do you think?



July 10th, 2009 at 3:35 pm
Nice article. I do most web development in PHP and would be curious to hear what people think about integration with JQuery/Dojo and the Zend Framework. Zend seems to promote Dojo but in theory also supports integration of JQuery in mcyh the same way. Does one work more seamlessly than the other?
Would agree that Djoj fails in its online documentation. JQuery seems to do a much better job with documentation and examples.
July 29th, 2009 at 7:47 pm
I’ve done a few projects with Dojo and yes I did struggle early on. It was like learning from scratch again. I was impressed, however, with Dojo, particularly with the Grid widget. I used it against Ruby on Rails, Java and PHP in the back end without having to change anything in Dojo as it integrated through JSON. I’m currently working on a project in Drupal and JQuery is built in so I don’t think I will be doing too much Dojo in the near future. Even though it is not open source Flash is more suited to my needs presently so I will be looking to it as my RIA technology.
July 30th, 2009 at 7:08 am
Yes, I have grown much more comfortable with Dojo and have even created a few widgets. The documentation is much better than when I first started (dojocampus.org). I developed using Flash for many years, but I switched to Ajax primarily for SEO reasons. I still use Flash on occasion, but because most search engines can’t read flash content, I try not to create an entire html page with Flash only.
October 27th, 2009 at 7:13 am
nice info sharing. Thank’s a lot for informatif posting ^_^
.-= hanum´s last blog ..Blog Launch Press Release =-.
January 3rd, 2010 at 9:01 pm
i have always been a Scriptaculous/Prototype user and been meddling with jQuery… now i found Dojo and it looks pretty neat… it does alot of cool stuff so i cant wait to use it but i wanted to know if it was compatible with any other javascript libraries… normally i choose one but i was just curious
.-= Carter Cole´s last blog ..Consuming Google Data APIs with ASP =-.
January 4th, 2010 at 8:34 am
I haven’t tried to use Dojo with another library on the same project, but I think it would work fine.
January 8th, 2010 at 3:00 pm
I’ve written cross-browser Ajax js code from scratch, and used JQuery and Dojo. Dojo for 2+ years. Dojo is definately not for beginners, and the documentation is poor, though the library and dijit library are well written. When you get into it you can do some fantastic things. But the learning curve is steep.
February 8th, 2010 at 2:48 am
I’ve chose Dojo library and I can’t say it was easy to learn. in fact, it wasn’t. But as Jim said, once you understand the architecture and the widgets structure, the possibilities just open up wide for a developer. Also, you can always compress the code and the number of server calls drop significantly (as per notes of Dojo being sluggish) …
Started a jQuery 2weeks ago (project decision) and I must admit, it’s slightly easier to build some basic functionalities…I’m now more into jQuery now, but just because I want to handle both.
October 12th, 2010 at 2:25 am
Coming from Actionscript/Flash and with some solid PHP knowledge, I was really looking into JavaScript for the first time just recently. I have to say that jQuery is served in a way that you get the “look no further”-feeling. I am just checking out DOjo because it’s good to know more…
November 21st, 2010 at 1:20 am
It’s taken me 8 hours to custom-style a DropDownButton, and I still haven’t gotten it completely looking like I want it to. What a nightmare. How does Dojo expect people to have control over the style of widgets when the structure of Dojo widgets is so complicated?? There needs to be some listing of all the styles affecting each widget — and no, sifting through style sheets in firebug isn’t gonna cut it (at least it didn’t work for me).
December 7th, 2010 at 5:04 pm
I’ve used Dojo for four years and I love it. Most developers I’ve worked with hate it and always suggest using JQuery.
The real beauty of Dojo is in it’s ability to create reusable and extend-able classes out of your javascript code. So you end up with a javascript application rather than code snippets here and there.
The technique i currently started invplves using Dojo to create the hull of my Javascript apps and JQuery inside of my methods, which has turned out to work really well.