Slashdot Mirror


Five AJAX Frameworks Reviewed

prostoalex writes "Dr. Dobb's Journal reviews 5 AJAX frameworks: Dojo 0.3.1, Prototype and Scriptaculous 1.4, Direct Web Reporting 1.0, Yahoo! User Interface Library 0.11.1 and Google Web Toolkit 1.0. Each framework was tested in two basic scenarios — writing a 'hub' (titled collapsible link list frequently seen on sidebars of many Web sites) and a 'tab panel' (horizontal tabbed navigation bar). During the process, Dr. Dobb's Journal reviewers noted that 'Dojo provides more features and HTML widgets than YUI and Prototype' but eventually 'settled on the Yahoo! User Interface Library.'"

15 of 187 comments (clear)

  1. MooTools by teknopurge · · Score: 2, Informative

    what about mootools?

  2. Re:Frameworks by Rasit · · Score: 2, Informative

    Am I the only one who usually finds frameworks to be pointless for serious web development? It's not that they're necessarily bad, but that they pack in dozens of features that you don't necessarily need (potentially bloating the size of your page download by tens to hundreds of K)[...]

    So write a script to remove all the unused functions. At least thats how we do it were I work.

  3. No, man, Joel drove them off the cliff: by smittyoneeach · · Score: 2, Informative

    Am I the only one who usually finds frameworks to be pointless for serious web development?
    http://discuss.joelonsoftware.com/default.asp?joel .3.219431.12
    --
    Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
  4. Frameworks versus Libraries by dmeranda · · Score: 4, Informative

    This sounds like the classic Framework versus Library debate. Some good reading:

    The Dojo mailing list thread "dojo: framework vs library"
    http://dojotoolkit.org/pipermail/dojo-interest/200 5-May/000231.html

    Joel Spolsky's "Why I Hate Frameworks"
    http://discuss.joelonsoftware.com/default.asp?joel .3.219431.12

    Arnon Rotem-Gal-Oz's "Frameworks vs. Libraries"
    http://www.ddj.com/blog/architectblog/archives/200 6/07/frameworks_vs_l.html

    That being said, there are plenty of features in Prototype which are more library-like than framework-like, so it is easy to use parts of it without buying into a whole framework methodology. I don't know much about the other evaluated tools.

  5. jQuery, too! by sbma44 · · Score: 4, Informative

    It takes the magical $() selectors of prototype, expands on them, and somehow delivers it all in 19k.

  6. Another good option by cabinetsoft · · Score: 5, Informative

    is jQuery and it's plugins.

  7. Old News? by russcoon · · Score: 5, Informative

    I'm Alex Russell, Project Lead for Dojo,

    We're obviously flattered that our little project got covered in DDJ, couldn't they have reviewed newer versions of the tools they covered?

  8. Re:Script# ? by vdboor · · Score: 2, Informative

    Something I also missed was xajax. They use AJAX as RPC layer, calling a server-side method from JavaScript, and in reverse call methods on the clients back. This is easy to implement in existing pages, and leaves much room for implementation.

    Instead of parsing data structures in the client, xajax allows you to send HTML chunks, JavaScript method calls and DOM operations back (making it two-way RPC). The most interesting part is you can reuse all server-side code created in the "web 1.0" days, like HTML template engines. :-)

    --
    The best way to accelerate a windows server is by 9.81 m/s2 ;-)
  9. Re:Security not a consideration? by foxyLady · · Score: 2, Informative

    Well, Fortify Software Security Research Group (which I am part of) has recently released a report ( http://it.slashdot.org/article.pl?sid=07/04/02/111 3242 ), where we discuss the new type of vulnerability we named JavaScript Hijacking.

    We believe that JavaScript Hijacking is the only type of vulnerability found so far applicable only to Ajax applications. We've also analyzed 12 most widely used Ajax frameworks (DWR, GWT, Microsoft "Atlas", xajax, Prototype, Script.aculo.us, Dojo, Moo.fx, jQuery, Yahoo! UI, Rico, and MochiKit) and determined that all the frameworks that use JSON and/or JavaScript for transferring data (except for DWR 2.0 which was not released at the time) are vulnerable to JavaScript Hijacking.

    To summarize, the vulnerability allows an unauthorized party to read confidential data contained in JavaScript messages. The attack works by using a tag to circumvent the Same Origin Policy enforced by Web browsers. Traditional Web applications are not vulnerable because they do not use JavaScript as a data transport mechanism.

    Complete report is available here: http://www.fortifysoftware.com/servlet/downloads/p ublic/JavaScript_Hijacking.pdf .

    As a side note, DWR 2.0 ( http://getahead.org/dwr/ ) and Prototype 1.5.1 ( http://prototypejs.org/2007/5/1/prototype-1-5-1-re leased ) have been recently released, and do contain fixes that prevent JavaScript Hijacking.

  10. Jquery by VGfort · · Score: 2, Informative

    Dojo is nice if you want widgets (month selector/accordian/...) but the documentation is rather weak. Personally I like JQuery, good docs and everything in 1 rather small file.

  11. Umm... hello? jQuery? by YourMotherCalled · · Score: 2, Informative

    "jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. jQuery is designed to change the way that you write JavaScript." - jQuery homepage

    jQuery is great because it's really small and really easy to use. I know very little about js and have absolutely no interest in learning all the gotchas related to cross-browser js development so I leave it to jQuery to do that for me. jQuery allows me to use js in a powerful way, easily and quickly.

    It's disappointing to not see jQuery in that list as if to say it's any less well made than the others.

  12. DWR by kevin_conaway · · Score: 2, Informative

    The name of the software is Direct Web Remoting

    How can we take this seriously if they don't know the name of the software they are evaluating?

  13. DWR = Direct Web REMOTING by spanielrage · · Score: 2, Informative

    WTF - this article might as well have been written last summer. DWR version 2.0 is now out and has been in beta for a while.

    The 'R' in DWR does not stand for for Reporting, but rather "Remoting". Both TFA and the ./ post are incorrect.

  14. Re:Just don't choose them all! by Thundersnatch · · Score: 2, Informative

    The only reason everyone uses Javascript to embed the files now is because of Microsoft's attempt to screw plug-ins.

    Microsoft got sued by a patent troll. Like it or not, MS were the good guys in this particular case, and aren't intentionally screwing anybody. Microsoft is trying to do the smart (and decent) thing by starving Eolas of future revenue. Microsoft and its deep pockets "took one for the team".

  15. AJAX frameworks are NOT pointless by francium+de+neobie · · Score: 4, Informative
    There are many little funny things that just happens when you're coding a web application in JavaScript without a framework/library/toolkit helping you. Unless you're really an AJAX/JavaScript wizard, coding an AJAX-enabled web application on your own and mixing online code receipts is a very dangerous thing to do.

    Browser inconsistencies
    This is the most obvious one, but only the entry to the rabbit hole. If you are not familiar with the example (maybe not exactly the same, but any AJAX web developer worth his salt should have seen one like that) I give below, then please, PLEASE, do yourself, your fellow developers and your users a favor, resist the urge to hack things together for once, use a mature AJAX framework.

    An important part of AJAX is that you need to update what is displayed on the web browser in the client side (by JavaScript), without refreshing the page. This implies that you're very likely to have to create and destroy DOM nodes on the fly. Now, how do you create a radio button in JavaScript?

    How about...

    var node = document.createElement("input");
    node.type = "radio"
    node.name = ...
    node.value = ...

    That's what you would do if you follow the DOM standard. But sorry, this does not work. Try to create a radio button with the above code segment in Internet Explorer 6, you'll get a broken radio button - you can't select it. The correct way to create a radio button by DOM manipulation is described in this MSDN article:

    newRadioButton = document.createElement("<INPUT TYPE='RADIO' NAME='RADIOTEST' VALUE='Second Choice'>")

    Memory leaks
    The last one was easy. Do you know you can make a web application that leaks memory like a sieve in Internet Explorer 6 by making a simple circular reference like the following one?

    var node = document.createElement("div");
    node.someAttr = node;

    If you're a good programmer, I might have sounded an alarm in your head right now - any circular references involving DOM nodes in IE6 results in memory leaks that persist after URL changes or page refreshes - unless you use an AJAX toolkit that takes care of the issue for you. Have you assigned a DOM as an attribute value under another DOM node in the past? Yes? Then you'd better check your web application for memory leaks with Drip, now.

    What's more, it's not just assigning DOM nodes as attributes that would result in memory leaks, closures in JavaScript can also form circular references and cause memory leaks. What makes closures particularly dangerous is that circular references with closures are not easy to spot. For example, the following code segment leaks:

    var node = document.createElement("div");
    var clickHandler = function(){};
    node.onclick = clickHandler;

    Looks innocent enough, but you've already formed a leaky circular reference here. node->clickHandler->node.

    For more information about memory leaks under IE6, read these:
    Mihai Bazon's blog entry
    MSDN's lengthy and confusing description of the problem


    The XMLHttpRequest object is not as simple as you think
    Much of the magic of AJAX comes from the XMLHttpRequest object (or its ActiveX equivalent, or an iframe, etc.), right? Sure. If you're only doing something simple via AJAX (like, updating the server time), then you can just copy an XMLHttpRequest code snippet from sites like this and hack away, right?