Original post written by Robert Nyman : Original Post [1]
After a lot of hard work, we’re more pleased than ever to present
the new version of DOMAssistant: faster, less code, better support and
improved stability. And more features, of course.
While we have actually made the code file size smaller, at the same time we have added a number of useful features and improved CSS selector performance.
In this version, we focused a lot on delivering Unicode support, implying support for basically any source document language. The web is, as you know, very international and it felt a bit hindering to only support English properly.
Naturally, we also wanted to measure up to other JavaScript libraries, and therefore we created the Slickspeed Unicode test [2] to show what we have accomplished. Hint: the DOMAssistant column is the one getting it right.
In line with our Unicode support, we now also offer complete documentation in Chinese (and as of before, in French). These translations are available as downloads from the documentation section [3].
cssSelect, ajax, setStyle, setErrorHandling and firstA number of new useful methods, after getting feedback from users and the community, have been introduced with this release:
cssSelect [4]
This method is used to perform a CSS selection on an already existing DOM element reference. Example:
$(document).cssSelect(".mandatory");
$$(DOMElementReference).cssSelect(".important[type=test]");).ajax [5]
The ajax method is a more detailed and precise way to
perform AJAX operations, where the web developer can fine-tune a lot of
settings. E.g.:
$("#container").ajax({
url: "ajax.php",
method: "POST",
params : "name=DOMAssistant",
callback: functionReference,
headers : {
"Content-type" :
"application/x-www-form-urlencoded"
}
});setStyle [6]
To apply direct inline styling to an element, to override CSS
applied from a CSS file or if you need to change something dynamically,
you can use the setStyle method. Example usage:
$("#container").setStyle("border", "10px solid red");
$("#container").setStyle({
background : "#ffffa2",
color : "#f00"
});setErrorHandling [7]
When using the DOMAssistant.DOMReady method to add
functions/methods to run as soon as the DOM is loaded, there’s now an
alternative to set an error handler if it fails:
DOMAssistant.DOMLoad.setErrorHandling(function (e) {
// e is the error object passed in
});first [8]
This is a helper method to get a reference to the first item returned in a CSS selection, and adding all the DOMAssistant methods to that element as well. For example:
$("#navigation a").first();Another thing that we in the DOMAssistant team is very important, and sometimes underrated by people, is performance and accuracy. With version 2.6 DOMAssistant had the overall fastest CSS selector performance, except for in Internet Explorer, where Ext JS [9] had very impressive results performance-wise.
We took that as a challenge, and improved the code for most web browsers while also seeing to that DOMAssistant now generally has the fastest CSS selector performance in Internet Explorer as well (results may vary…).
Try the Slickspeed test [10] to see the new results!
Another thing we have done is fixing the accuracy of some CSS selectors, and general method behavior has been modified to minimizing the risk for errors and delivering a more stable experience.
We are very happy with this release and would love for you to download DOMAssistant [11] and try it out.
Join us in the world DOMination! ![]()
Links:
[1] http://www.domassistant.com/blog/2008/04/09/domassistant-27-released-better-performance-more-features-smaller-file-size/
[2] http://www.domassistant.com/slickspeed-unicode/
[3] http://www.domassistant.com/documentation/
[4] http://www.domassistant.com/documentation/DOMAssistantCore-module.php#cssSelect
[5] http://www.domassistant.com/documentation/DOMAssistantAJAX-module.php#ajax
[6] http://www.domassistant.com/documentation/DOMAssistantCSS-module.php#setStyle
[7] http://www.domassistant.com/documentation/DOMAssistantLoad-module.php#setErrorHandling
[8] http://www.domassistant.com/documentation/DOMAssistantCore-module.php#first
[9] http://extjs.com/
[10] http://www.domassistant.com/slickspeed/
[11] http://code.google.com/p/domassistant/downloads/list