Plugins

The plugins site is currently in development.

We've been looking to provide a higher-quality, spam-free experience at the plugins site for some time, and a major error on our part forced us to shut down the current site before we could put the new one in place. We are developing a new site, and you can follow along with its development on GitHub. For more information about this transition, including steps you can take as a plugin author to prepare, please read our post about what's going on.

flXHR Proxy


flXHR is a flash+javascript solution for cross-domain Ajax communication. It implements an identical API to the native XHR object, which allows you to drop in flXHR into an existing page without any further code changes. This makes it particularly useful with Javascript frameworks like jQuery.

Since flXHR is emulating full compliant XHR, you will be able to make cross-domain calls for any kind of content, including HTML, text, binary, XML, JSON/P. You are not restricted to JSONP as you are with just core jQuery.

Because flXHR uses flash (an invisible swf instance), it leverages Adobe's crossdomain.xml server opt-in policy model to allow the cross-domain communication. This means the target URL you are making Ajax requests against must be able to serve up a compliant crossdomain.xml policy which authorizes your site to communicate with it.

While you can already adapt jQuery to use flXHR by overriding the 'xhr' setting in the Ajax Options, it doesn't give you much intelligence or flexibility in customizing your flXHR configuration options for different requests. It works for simple pages with only one (or one type of) request, but as soon as the page needs more sophistication, or when you want flXHR used only for some of your page's requests, you need something more sophisticated.

So, this plugin, which utilizes the new jQuery 1.3 XHR Registry, registers flXHR as an Ajax XHR variant so you can tell the core jQuery library to use flXHR under more complicated configuration options. It is considered the best practice at this point for adapting jQuery to use flXHR.

Specifically, this plugin uses the registry to associate a particular set of flXHR options with a specific unique URL (or partial URL). The registry will then select flXHR (and those options) for any Ajax request which matches that target URL or partial URL.

Because flXHR is completely API compliant to normal native XHR Ajax, you will not need to change any of your other jQuery code. You simply register flXHR on page load and jQuery core and the XHR Registry will take care of the rest. How much easier could cross-domain Ajax be?

Downloads



5
Your rating: None Average: 5 (1 vote)