getify | Ajax, Misc, RIA | Friday, August 21st, 2009
This is a topic I’m very passionate about and I hope I can count on your support to help the talk get picked for the event. There’s over 3000 submissions for only 300 spots, so every vote counts!
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 first project is called LABjs (Loading And Blocking JavaScript). Put simply, this is a little tool (2.5k compressed) that lets you load Javascript assets dynamically, in parallel, but still allows you to define “blocking”, which is to wait for one or a set of scripts to load before executing other code, such as perhaps loading more scripts.
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.