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:

  1.  
  2. new Ajax.Request(’myurl’, {
  3.   method: ‘GET’,
  4.   crossSite: true,
  5.   parameters: Form.serialize(obj),
  6.   onLoading: function() {
  7.     //things to do at the start
  8.   },
  9.   onSuccess: function(transport) {
  10.     //things to do when everything goes well
  11.   },
  12.   onFailure: function(transport) {
  13.     //things to do when we encounter a failure
  14.   }
  15. });
  16.  

Source: Ajaxian
Original Article: http://feeds.feedburner.com/~r/ajaxian/~3/175388280/introducing-a-cross-site-ajax-plugin-for-prototype

Leave a Reply

You must be logged in to post a comment.



Site Navigation