JavaScript
Article
By Sam Deering

jQuery is better than DOJO! (11 Reasons)

By Sam Deering
Help us help you! You'll get a... FREE 6-Month Subscription to SitePoint Premium Plus you'll go in the draw to WIN a new Macbook SitePoint 2017 Survey Yes, let's Do this It only takes 5 min

jquery-vs-dojo

This post is now outdated, It has been kept here for entertainment purposes only.

Overview

Both jQuery and DOJO are JavaScript Development Frameworks/Packages that provide functions to make the writing of JavaScript code easier, faster and more efficient. Both have strengths and weaknesses, advantages and disadvantages but here on jQuery4u we love jQuery and think it’s the best so this list is all about how jQuery kicks DOJO a$$! In my opinion, Dojo is a framework and JQuery a library so it can be hard to compare them in most areas… but we’ll give it a go!

jQuery Official Definition

“jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript.” source: http://jquery.com/

DOJO Official Definition

“Dojo saves you time, delivers powerful performance, and scales with your development process. It’s the toolkit experienced developers turn to for building superior desktop and mobile web experiences.” source: http://dojotoolkit.org/

--ADVERTISEMENT--

10 Reasons why is jQuery better than DOJO!

js-min-filesizes

Update 06/07/2011: I must just add that DOJO has improved a hell of a lot since I wrote this post and some of the info here is a bit outdated (although most of it is still relevant).

  1. jQuery library is slightly smaller than DOJO! – When you download and look at the filesize your get jquery-1.6.2.min.js is 89.4kb and dojo-1.6.1.min.js is 92kb (compressed).
  2. jQuery is less confusing than DOJO! – Dojo is becoming an operating system – without providing the necessary documentation… Dojo epic fails in online documentation.
  3. jQuery works better with Firebug than DOJO! –  jQuery great with Firebug debugging whereas some of the cryptic messages that are displayed from Dojo Toolkit are nearly impossible to figure out!
  4. jQuery is easier to learn than DOJO. Another Fact. If you just do a Google search on “jQuery Code Snippets” and “Dojo Code Snippets”… how many people want to share their code?
  5. jQuery has more plugins available than DOJO! – jQuery has hundreds of unofficial plug-ins in a directory at plugins.jquery.com while DOJO doesn’t really do plugins but there are a few here: http://dojotoolkit.org/reference-guide/dojox/editor/plugins.html.
  6. jQuery community is far larger than DOJO! – If you measure jQuery and DOJO on metrics like the number of people using it, the number of search queries run on Google, the number of books sold, etc, you’ll see jQuery is ahead by a wide margin.
  7. jQuery is better with AJAX than DOJO! – It works with AJAX faster than DOJO. Fact. jQuery.AJAX() is king and also provides shorthand versions in jQuery.getJSON() and jQuery.getScript()
  8. jQuery has sexier looking syntax than DOJO! – This ones a personal opinion of mine… a very subjective observation! (but check the code below and you will see why!)
  9. jQuery loads faster in IE6 and 7  than DOJO! – Proof is below!!!  (results by Slickspeed).
  10. jQuery is updated more regularly than DOJO! – Simply better performance due to more updates and bug fixes from a dedicated team. See The Performance Results Tables.
  11. Dojo doesn’t even have it’s domain name! – http://www.dojo.com is about figuring out how friends can help one another on the path to mastery.

speed-results-jquery-ie

Example of code in Plain JavaScript

Consider this JavaScript snippet, which uses simple string functions:

var value = "Hello" + name ", it's " + time + " o'clock";
value.replace(".", ":");

Example of code in DOJO

Even simple string functions are harder in DOJO:

dojo.require('dojo.string.substitute');
var newstring = dojo.string.substitute("Hello ${name}, it's ${time} o'clock", {
    name: "Horst",
    time: new Date()
});

Example of code in jQuery

Consider this jQuery snippet, which disables all SELECT tags on a page:

$('#formid').children('select').prop('disabled', true);

Example of code in DOJO

Here is how you might go about doing it in DOJO, yes I know it’s ugly!:

dojo.forEach(
  dojo.query("select", document),
  function(selectTag) {
      selectTag.disabled = true;
  }
);

Well, I hope this short post helps spread the word that jQuery is better than DOJO! Please don’t take my post the wrong way i’m obviously a jQuery Fanboy at heart! ;-)

Login or Create Account to Comment
Login Create Account
Recommended
Sponsors
Get the most important and interesting stories in tech. Straight to your inbox, daily.Is it good?