DOMAssistant 2.7.4 out!

October 31st, 2008 by chenghong

Update:  Version 2.7.4 has been released to address a regression bug that affects the addClass(), removeClass() and replaceContent() methods. Please update to this version. Sorry if it has caused any inconveniences!

We are pleased to announce that your favorite Javascript library has just received an update! Yes, it’s a zero-point-zero-one version increment, but make no mistake about it – DOMAssistant 2.7.3, while continuing its promise of being extremely light and fast, sees the addition of some much requested features and fixes, including:

Support for “opacity” with getStyle() and setStyle()

You can now get or set the opacity of an element with the following syntax. It works across browsers, of course.

elm.setStyle("opacity", 0.5);
elm.setStyle({ color: "blue", opacity: 0.3 });
var opacity = elm.getStyle("opacity");    // 0.3

JSON response native parsing with eval fallback

If the responseType is set to “json” in an Ajax call, DOMAssistant will attempt to evaluate the response with the native JSON.parse function whenever possible.

elm.ajax({
    url: "getDateTime.php",
    responseType: "json",
    callback: function (obj) {
        var date = obj.date;
        var time = obj.time;
    }
});

Support for timeout and exception handling in Ajax

Two optional parameters, “timeout” and “exception”, have been added to Ajax setup config. As their names suggest, they allow you to define the timeout interval for an Ajax request, and an exception handler to deal with the situation whenever error arises. Timeouts are considered a type of error as well.

elm.ajax({
    url: "getDateTime.php",
    responseType: "json",
    callback: function (obj) {
        var date = obj.date;
        var time = obj.time;
    },
    timeout: 5000,    //in ms
    exception: function (err) {
        alert("Error: " + (err.message || err.description));
    }
});

Enhanced removeEvent() capable of removing all handlers binded to an event

Previously you must specify the event and the function reference if you need to remove an event handler. This means anonymous functions and inline event handlers could never be removed without some brute forces. This issue has now been addressed with the improved API that allows you to omit the function reference in a removeEvent() call.

elm.removeEvent("click", doSomething);   // Removes the doSomething click event handler
elm.removeEvent("click");                // Removes all click event handlers

Exceptional performance

DOMAssistant 2.7.3 now leads other major libraries by an even larger margin in selector’s performance. It also stacks up pretty well against up and coming libraries. Performance enhancement has been made in the Ajax department too, where requests are now pooled and reused. Special thanks to David DeCarmine on this one!

Other fixes

[Chg] Inline events now gets triggered with triggerEvent()
[Fix] Multiple selector accuracy fixes in edge cases
[Fix] getStatus() and getStatusText() now works from within the Ajax callback function
[Fix] getStyle() for “float”, “width” and “height” now return correct values in IE
[Fix] Event handle threw error under rare circumstances in IE

Download

DOMAssistant 2.7.3 is drop-in replacement for the last version and is available for download now. We hope you enjoy this release. Feedback welcomed!

4 Responses to “DOMAssistant 2.7.4 out!”

  1. jj says:

    is this project alive?
    Damn.. so many libraries and frameworks.. I just want something simple like Flow.js (flowjs.com), which seems totally dead, or Base2, which I am not sure it’s what I need, or DOMAssistant, but I’m not sure this is alive either.

  2. chenghong says:

    DOMAssistant is well alive and kicking. Version 2.8 is currently in testing and will be released some time this month. One of the favorite features in 2.8 is event delegation. Be sure to check back soon! (Or, head over to domassistant.googlecode.com to download the latest build for a test run.)

  3. ern0 says:

    “Damn.. so many libraries and frameworks.” – Yep, you’re right. I’ve been hanging around the Net for a month for a JS framework which 100% suits my taste. I haven’t spent more than 10 mins for one: if there were something I don’t like, I’ve just threw it away.

    Then I found DomAssistant, and I said several times “that’s it”, during reading the manual of the base module.

  4. Perfect Website…Thanks For Putting it together

Leave a Reply