Ajax and Ajax Frameworks

I have been a developer for nearly 20 years and a web developer for about 10 years. Over the years, I have considered creating a blog to share the things I have learned (and am learning) about web design and development, but I never seemed to have the time. When I began learning about web development using Ajax and Ajax Frameworks, I decided to take the time to create this blog.

My intention for this blog is to focus primarily on Ajax Frameworks, but since web development requires knowledge of many technologies, I will occasionally write about things such as CSS, Javascript, PHP, MySQL, Flash, etc.

Lately, I have been using JQuery as my primary Ajax tool. Although I have used other Ajax Frameworks in the past (Dojo Toolkit, Yahoo! User Interface Library, Scriptaculous/Prototype), JQuery has thus far been the easiest to learn. In my first few posts I will discuss some of the JQuery Plugins that I have created. Some of these include: a plugin for Google Maps (jquery.imGoogleMaps), Form validation and submission  (jquery.imValidateForm), Page Populater (jquery.imPagePopulate), and a plugin to create lists (jquery.imList).

While I am still learning about some of the other Ajax Frameworks, I hope that what I have learned will be helpful to others. Just remember, “When you can pull the pebbles from my hand…”

Dojo vs JQuery, Part 2: Plugins, Widgets

Friday, June 5th, 2009

Not long after I begin learning a new Javascript Framework, I find a need to create a plugin (or widget). I have created quite a few JQuery plugins (see previous posts) and have recently created a my 4th Dojo Widget (I have also created a few YUI widgets). I recently began working on a  JQuery photogallery plugin (I know, why re-create the wheel). I actually created this photogallery quite a few years ago, but not as a JQuery Plugin, but as a Javascript object (class). I am now converting it into a JQuery plugin.

While working on a different project (that uses Dojo), I also had to create a photogallery. While I enjoyed the benefits of using both JQuery and Dojo to re-create the photogallery, I have to say that the ability to create a template (Dojo Widgets) can significanly decrease the time it takes to create a plugin or widget.

When I initially read about Dojo widget templates, I didn’t really understand the need. My perception was that if a developer was fairly proficient with creating and manipulating DOM elements, then what is the need for a template? Well, creating this plugin using both JQuery and Dojo gave me a more favorable perception of using templates – a tremendous advantage.

Although the requirements for the JQuery photogallery plugin was a bit more complex (and although I still find it easier in general to develop using JQuery), I have to say that having the ability to create a template gives Dojo a real advantage over JQuery when creating widgets or plugins.  Advantage: Dojo.

Related posts

6 Responses to “Dojo vs JQuery, Part 2: Plugins, Widgets”

  • Thadeus Says:


    It seems that you have had a lot of experience developing with different JavaScript frameworks.

    What is your favourite?

    I am currently using jQuery, however, I am curious to start playing around with Dojo.

    I use python for a backend, and I have built a class that generates jQuery code for me (ajax, dialogs, etc..) so that my webserver has a better idea of what is going on on the client side. Since it knows about the javascript variables, and I can return javascript instead of json and have it evaled to manipulate the dom from serverside. This is great since my python backend knows about the jquery variables and html dom structure (web2py helpers)

    My question is this, do you think that jQuery or Dojo is more suitable for that kind of application?
    Thadeus´s last blog ..pygame font and py2exe =-.

    My ComLuv Profile

  • admin Says:


    I have found that it is more difficult to compare JQuery and Dojo (or YUI for that matter). Dojo and YUI, while bloated, have integrated interface elements into their frameworks from the beginning (creating web OSs). JQuery created jquery-ui only a few years ago. That being said, I have always found it easier (and quicker) to develop using JQuery. And their ui is more flexible.

    As far as returning Javascript, wouldn’t it be more efficient to return data only. I may be a bit biased. I don’t even like to return html markup. data only.

  • Thadeus Says:


    So if you wanted to create something that relies heavily on javascript ui, (like a webmail that looks like outlook), use Dojo. If you wanted something to just “enhance” your page to provide “usability” such as star ratings, or ajax suggest or simple one dialogs, use jQuery?

    As far as returning javascript, I am learning javascript, and how it interacts with a webserver. To help me get started I wrote the python library that generates the jQuery code, so I could do something such as

    return js.dialog(”Title”, “Content”);

    that will render the element and include the necessary javascript to turn it into a dialog, all from python.

    But perhaps for more advanced application (like my dojo example) there will be no way around learning javascript?
    Thadeus´s last blog ..pygame font and py2exe =-.

    My ComLuv Profile

  • arno Says:


    thadeus –

    would you be willing to share your python library that generates jquery code? it sounds interesting!

    cheers,
    @rno

  • Thadeus Says:


    Sure, it is located on my mercurial repository at http://hg.thadeusb.com/public/.r/Web/py2jquery/summary

    I am currently going through a major overhaul and rewrite of the code. Take a look at the examples.txt for usage.

    This is designed to be used with web2py, however it theoretically will work with other python frameworks as well.
    Thadeus´s last blog ..pygame font and py2exe =-.

    My ComLuv Profile

  • Paul Says:


    hello,
    nice comparison of these two frameworks. Currently I’m using jQuery to make enhancements to websites, but i’ve just started learning ZEND Framework and it looks like it’s creators prefer Dojo.

    Now i see when use which framework, jquery for simple ajax and visual enhancements, and Dojo for complex applications.

    Thanks

CommentLuv Enabled