Also, inspired by the code we worked out for the Mootools plugin, I have released updates to the jQuery plugin, Dojo plugin, and the Prototype plugin. These three plugins now play nicely with each respective framework’s built in error mechanism for normal Ajax calls.
Prior to this release, error handling was only possible by manually setting the “onerror” property in the flXHR instance configuration properties. This same functionality is still supported. But now the recommended approach is to specify your error callbacks directly in your Ajax/Xhr calls as you normally would. Note: Do only one or the other, not both, to avoid duplicate callback execution in some circumstances.
Now that flXHRproxy is more tightly integrated with each framework’s event mechanism, the ease with which you can make cross-domain Ajax calls just keeps getting better and better! Really, what excuse do you still have for not using flXHR for your next cross-domain Ajax call?
One last note: the jQuery update also includes one additional change. The “success” callback function signature is now extended to include a third parameter, which is set to the flXHR instance (XHR) that generated the call/response. This makes it much easier to determine which specific Ajax call the response comes from.
I wanted to slightly diverge from flensed project discussions for this post to talk briefly about two other projects I’ve recently released. The reason for talking about them here is that one or both of them may find some cooperative use or even code sharing with flXHR/flensed in the next version releases, so there is a symbiotic relationship between them.
The main purpose of LABjs is to load scripts dynamically, in parallel, instead of old-school <script> tags which only load one at a time, and block everything else on the page. This significantly speeds up your page load. At the same time, you do sometimes still need to block and wait for some script to get loaded before doing other things. So, you get both in one simple loader API.
For instance, say you’re on a page that needs jQuery, but also needs a number of jQuery plugins. You need to load jQuery core itself, blocking on that download, and the ideally load all the other plugin files afterwards, in parallel, to get the page rendered and functional as quickly as possible. LABjs makes this type of functionality drop-dead simple.