aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes jQuery vs Dojo Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "jQuery vs Dojo" Watch "jQuery vs Dojo" New topic
Author

jQuery vs Dojo

Bai Shen
Ranch Hand

Joined: Sep 24, 2008
Posts: 323
I'm looking at writing a couple of Ajax applications. One is just a simple gui to set some configuration options, etc for a web service. However, the other is a complete rewrite of an existing application/applet.

I did a little bit of work with Dojo over a year ago. It seemed okay, but ended up being rather slow. Not sure if that was because I only used a small piece of their library.

From what I've read, it seems that Dojo has greatly improved their speed. But I've also heard good things about jQuery.

So basically I'm looking for advice and pros/cons of the two libraries. I'm open to suggestions for other libraries, but these are the two that I'm most likely to use.

Oh, and I can't use GWT due to licensing.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61606
    
  67

You can't really go wrong with either library. In my opinion, Dojo is bit more invasive and less extensible, but broader in scope. jQuery is light and flexible, and is the library I personally prefer. (When you consider the jQuery plugins, the scope between Dojo and jQuery severely narrows.)

For what it's worth, there appear to be more jQuery users who frequent these forums than Dojo.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bai Shen
Ranch Hand

Joined: Sep 24, 2008
Posts: 323
Can you elaborate on the plugins issue? Are there any places where Dojo does things that jQuery doesn't?

How do the plugins work? Are they just imports, like using another jar in java?

What would you suggest as a good starting point to learn jQuery? I'm a fairly knowledgeable java dev, but don't really have any javascript experience(what little I've done has been purged).
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61606
    
  67

Originally posted by Bai Shen:
Can you elaborate on the plugins issue? Are there any places where Dojo does things that jQuery doesn't?

Dojo comes with pretty much everything. jQuery's core is light-weight and there's a very healthy and thriving community of people writing plugins for it. jQuery was designed for plug-ability from the get-go and it's very easy to extend. I write a lot of my own JS code as jQuery extensions.

How do the plugins work? Are they just imports, like using another jar in java?
Pretty much. Include the jQuery core, then include any plugins you want to use.

What would you suggest as a good starting point to learn jQuery?
My book, of course. But if you'd rather not buy something just yet, the documentation at the jQuery site is as decent as on-line docs get.

There's also this article published in Dr. Dobbs that's a reworking of the jQuery section I wrote for Ajax in Practice. It might be a good spring-board.

I'm a fairly knowledgeable java dev, but don't really have any javascript experience(what little I've done has been purged).
Then to be honest, I'd recommend my book. Start out by reading the Appendix which contains a JavaScript refresher with jQuery usage in mind. P.S. All the book's server-side examples are in Java/JSP.
[ October 23, 2008: Message edited by: Bear Bibeault ]
Bai Shen
Ranch Hand

Joined: Sep 24, 2008
Posts: 323

Dojo comes with pretty much everything. jQuery's core is light-weight and there's a very healthy and thriving community of people writing plugins for it. jQuery was designed for plug-ability from the get-go and it's very easy to extend. I write a lot of my own JS code as jQuery extensions.


So functionality wise, I should be okay with jQuery as long as I can find the plugins.

My book, of course. But if you'd rather not buy something just yet, the documentation at the jQuery site is as decent as on-line docs get.

There's also this article published in Dr. Dobbs that's a reworking of the jQuery section I wrote for Ajax in Practice. It might be a good spring-board.

Then to be honest, I'd recommend my book. Start out by reading the Appendix which contains a JavaScript refresher with jQuery usage in mind. P.S. All the book's server-side examples are in Java/JSP.


Thanks, I'll check out the link. No offense to your book, but I'd rather not purchase anything right now. I still have these two O'Reilly books from my brief dojo stint.

Ajax On Java
JavaScript Reference Guide

So I'm hoping to at least get things rolling with those right now.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61606
    
  67

That's cool. You know where to come for help!
Bai Shen
Ranch Hand

Joined: Sep 24, 2008
Posts: 323
Yup. I've decided to get the rest of my application up and running so I can hopefully start trying to piece the Ajax parts together next week.
Bai Shen
Ranch Hand

Joined: Sep 24, 2008
Posts: 323
Well, my jQuery foray didn't go so well, so I ordered your book. Should be here Monday. I'll let you know what I think.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61606
    
  67

Please do! Most people seem to find it helpful (even the "bad review" on Amazon says "This book is great, but I don't like books" :roll: ). Hope it helps you out too.

And of course, you can post here with questions.
Bai Shen
Ranch Hand

Joined: Sep 24, 2008
Posts: 323
Yeah, I had to chuckle at that review.

I'm just annoyed because it arrived friday, and I didn't realize it, so I didn't get to read it over the weekend.
Mathew Kuruvilla
Ranch Hand

Joined: Nov 27, 2001
Posts: 135
I see that there are more people using jQuery than Dojo. Also, there appears to be more books on jQuery than Dojo.
However, I have decided to go with Dojo for the following reasons:
1) dojo provides charting via dojox.gfx. For others, you need to go outside the environment to get charts.
2) jQuery is supported by non-unix organizations. dojo is supported by unix organizations. As a Java person, I favor unix.
3) jQuery site is a .com site. dojo site is a .org site.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61606
    
  67

Your last two points are rather ridiculous.

Mathew Kuruvilla wrote:2) jQuery is supported by non-unix organizations. dojo is supported by unix organizations. As a Java person, I favor unix.

Huh? Just because Microsoft chose to include jQuery in its Visual Studio packaging doesn't in any way make jQuery anti-Unix. That's like saying "Firefox runs on Windows, so it's anti-Unix". In fact, the vast majority of jQuery movers and shakers are OS X users -- the only commercially viable Unix platform there is.

3) jQuery site is a .com site. dojo site is a .org site.

What the heck does that have to do with anything? You might just as well have used the background color of the sites as a deciding factor -- or whether the IP addresses are odd or even.

There are many valid reasons to pick one library over the other. These two are just uninformed and ludicrous.
Mathew Kuruvilla
Ranch Hand

Joined: Nov 27, 2001
Posts: 135
Ok. Ok. I guess I was a little paranoid . . .

But generally, I am suspicious of .com sites and also I am suspicious of any software backed by Microsoft.
I won't ever forget the Microsoft Virtual Machine nor the AFC . . . . .
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61606
    
  67

jQuery is not backed by Microsoft -- it is used by Microsoft. Microsoft has nothing whatsoever to do with the development of jQuery. Do you also boycott cardboard because Microsoft uses it to make the boxes for their software?

Suspicious of .com sites? Sorry, but that's a serious "what the...???" And if so, you realize that you are posting at coderanch.com, right?

Mathew Kuruvilla
Ranch Hand

Joined: Nov 27, 2001
Posts: 135
I agree with you now. I was mistaken in stating that Microsoft backs jQuery.
And certainly I am mistaken in whatever assumptions I had made regarding
.com and .org sites.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jQuery vs Dojo