Introducing a cross site Ajax plugin for Prototype
Written by on October 26th, 2007 in Ajax News.
Thierry Schellenbach has implemented a Prototype plugin that allows you to do cross site remoting using the dynamic script tag method that other frameworks such as Dojo and jQuery have supported for awhile.
You can implement this by simply setting crossSite: true as a config parameter to Ajax.Request:
JAVASCRIPT:
-
-
new Ajax.Request(’myurl’, {
-
method: ‘GET’,
-
crossSite: true,
-
parameters: Form.serialize(obj),
-
onLoading: function() {
-
//things to do at the start
-
},
-
onSuccess: function(transport) {
-
//things to do when everything goes well
-
},
-
onFailure: function(transport) {
-
//things to do when we encounter a failure
-
}
-
});
-
Source: Ajaxian
Original Article: http://feeds.feedburner.com/~r/ajaxian/~3/175388280/introducing-a-cross-site-ajax-plugin-for-prototype