flXHR gets some Prototype love, cross-domain Ajax wins!
In the wake of the jQuery flXHRproxy and Dojo flXHRproxy plugins recently released, Prototype was unfortunately left out of having a good solid plugin for flXHR… until now!
Austin resident Prototype guru Andrew Dupont recently wrote an initial version of the plugin, which I then modified and tested, and we now have a great plugin for Prototype to support flXHR in the same way as the other frameworks.
Just like with the other framework plugin versions, you simply call ‘registerOptions(…)’ to register a URL (or partial URL) destination target and a set of flXHR options to be used for that location. Then, when you later make various Ajax calls, Prototype will internally figure out if you are calling to a location that is registered and will use flXHR with the options you specified.
There is simply no other way to get easier cross-domain Ajax with Prototype than with flXHR and flXHRproxy. Take a look at flXHRproxy documentation or give the Prototype+flXHR demo a whirl.
Typical page usage might look like this:
Ajax.flXHRproxy.registerOptions('http://www.mydomain.com/',{xmlResponseText:false...});
Ajax.flXHRproxy.registerOptions('http://rss.mydomain.com/',{xmlResponseText:true...});
...
Ajax.Request('http://www.mydomain.com/something.html',{...});
...
Ajax.Request('http://rss.mydomain.com/feed.html',{...});
Enjoy the new world of possibilities and fun that Prototype and flXHRproxy now gives you for doing easy cross-domain Ajax!