I would like from a site myDomain.com request data from another site anotherDomain.com through Ajax.Request. If possible could you point me with an example. Thanks for your help. Pierre --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
For a cross browser solution it is best to go with "ajax proxy". http://ajaxpatterns.org/Cross-Domain_Proxy - kangax On Apr 15, 8:41 am, pierreva <pierre.vaud...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I would like from a site myDomain.com request data from another site > anotherDomain.com through Ajax.Request. If possible could you point me > with an example. > Thanks for your help. > > Pierre--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Depending on what you''re fetching, you can also dynamically add another javascript tag pointing to another URL: $("someDiv").insert(new Element("script", { type:''text/javascript'', src:''http://www.yourDomain.com/test.js'' })) There will be no opportunity to sanitize what the response will be and it will execute upon load, so be careful. On Apr 15, 8:41 am, pierreva <pierre.vaud...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I would like from a site myDomain.com request data from another site > anotherDomain.com through Ajax.Request. If possible could you point me > with an example. > Thanks for your help. > > Pierre--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
In this page : http://pierre.vaudrey.free.fr/actes/acte_mari.php?xid=866 there is a link javascript: num_img(69, 2, 2) with the following ad_test.js which use submodal to render an image : function num_img(commune, lot, acte){ var url = ''http://ad01.vtech.fr/etatcivil.html?btCom=''+commune; //alert(url); var myAjax = new Ajax.Request(url, {method:''get'', onComplete: getCommune}); /* ajax.Response */ function getCommune(transport) { alert(transport.status); if(transport.status != 200){alert("Unavailable.")}else{ var a = transport.responseText; //alert(a); } } var url1 = ''http://ad01.vtech.fr/visu2/visu.html?NumLot=''+lot; var myAjax1 = new Ajax.Request(url1, {method:''get'', onComplete: getLot}); /* ajax.Response */ function getLot(transport) { if(transport.status != 200){alert("Unavailable.")}else{ var d = transport.responseText.stripTags(); matches = d.match(/\d+/g); var num_img = matches[6]; //alert(num_img); } } var url2 = ''http://ad01.vtech.fr/visu2/visu.html?INB=''+acte; var myAjax1 = new Ajax.Request(url2, {method:''get'', onComplete: getINB}); /* ajax.Response */ function getINB(transport) { if(transport.status != 200){alert("Unavailable.")}else{ var e = transport.responseText.stripTags(); matches_INB = e.match(/\d+/g); var num_img_INB = matches_INB[6]; var url3 = "http://ad01.vtech.fr/visu2/visui.php? IMAGE="+num_img_INB+"&SI=img0"; showPopWin(url3, 990, 550, null); //alert(num_img_INB); } } } Could you help me to find a solution ? Thanks for your help. Pierre On 15 avr, 20:58, Diodeus <diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Depending on what you''re fetching, you can also dynamically add > another javascript tag pointing to another URL: > > $("someDiv").insert(new Element("script", { type:''text/javascript'', > src:''http://www.yourDomain.com/test.js''})) > > There will be no opportunity to sanitize what the response will be and > it will execute upon load, so be careful. > > On Apr 15, 8:41 am, pierreva <pierre.vaud...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I would like from a site myDomain.com request data from another site > > anotherDomain.com through Ajax.Request. If possible could you point me > > with an example. > > Thanks for your help. > > > Pierre--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---