[Proto-Scripty] Re: HTTP OPTION REQUEST with FireFox 3.5
I tried the Access-Control in two servers of my own: www.trusted-server.com: var options = { onSuccess: function(req) { $("debug").insert(req.responseText); }, onException: function(req, ex) { alert(ex); } }; new Ajax.Request("http://external-server.com/test.php";, options); www.external-server.com/test.php: I'm cheking twitter and seems that the server doesn't send the "Access- Control-Allow-Origin" nor "Access-Control-Allow-Headers", so maybe you cannot apply the Access-Control policies in this case. All the process is very well explained in https://developer.mozilla.org/En/HTTP_access_control On 17 ago, 14:31, Omar Adobati wrote: > Thanks for your answer, but I think I'm a bit confused.The remote server, > i.e. would be the one I'm trying getting data from (i.e. twitter server). > If I haven't misunderstood what are you saying, I should apply those headers > to that server? > Or Am I completely wrong? (which I hope to) > > Thanks again, > > --- > Omar Adobati > > Sent from Düsseldorf, North Rhine-Westphalia, Germany > > > > On Mon, Aug 17, 2009 at 13:57, mmacia wrote: > > > The script that processes the ajax request in the remote server must > > set these headers. I can post a full example if you want. > > > On 17 ago, 13:53, Omar Adobati wrote: > > > What do you mean with "the server side"?Can you please clarify it to me? > > > > Thanks, > > > > Omar > > > --- > > > Omar Adobati --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: HTTP OPTION REQUEST with FireFox 3.5
Thanks for your answer, but I think I'm a bit confused.The remote server, i.e. would be the one I'm trying getting data from (i.e. twitter server). If I haven't misunderstood what are you saying, I should apply those headers to that server? Or Am I completely wrong? (which I hope to) Thanks again, --- Omar Adobati Sent from Düsseldorf, North Rhine-Westphalia, Germany On Mon, Aug 17, 2009 at 13:57, mmacia wrote: > > The script that processes the ajax request in the remote server must > set these headers. I can post a full example if you want. > > On 17 ago, 13:53, Omar Adobati wrote: > > What do you mean with "the server side"?Can you please clarify it to me? > > > > Thanks, > > > > Omar > > --- > > Omar Adobati > > > > > > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: HTTP OPTION REQUEST with FireFox 3.5
The script that processes the ajax request in the remote server must set these headers. I can post a full example if you want. On 17 ago, 13:53, Omar Adobati wrote: > What do you mean with "the server side"?Can you please clarify it to me? > > Thanks, > > Omar > --- > Omar Adobati > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: HTTP OPTION REQUEST with FireFox 3.5
What do you mean with "the server side"?Can you please clarify it to me? Thanks, Omar --- Omar Adobati > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: HTTP OPTION REQUEST with FireFox 3.5
Good news, I solved the problem. The server side must set these headers (PHP): header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Methods: POST, OPTIONS'); header('Access-Control-Allow-Headers: x-prototype-version,x-requested- with'); Works on all Access-Control capable browsers (Firefox, Chrome & Safari). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: HTTP OPTION REQUEST with FireFox 3.5
I forgot the link to mozilla doc: https://developer.mozilla.org/En/HTTP_access_control On 17 ago, 09:44, mmacia wrote: > Same error here, > Mozilla documentation says that in a cross domain call there are two > response headers: OPTIONS and POST > Prototype receives the OPTIONS one but the POST is lost. > > On 16 ago, 18:32, Omar Adobati wrote: > > > > > Hi Andrew, > > > I'm sorry to be so in late but I was quite busy with my job in the past > > days, anyway, here you ca test the same request with both prototypejs > > framework and the xmlhttp object: > > http://www.adobati.it/labs/test/ > > > Let me to know what do you think! > > > --- > > Omar Adobati > > > On Thu, Aug 6, 2009 at 15:55, Omar Adobati wrote: > > > Sure, > > > I will and I will let you to know. > > > > Thanks, > > > > Omar > > > > Sent from Düsseldorf, North Rhine-Westphalia, Germany > > > > On Thu, Aug 6, 2009 at 15:48, Andrew Dupont > > > wrote: > > > >> Omar, can you try rewriting this code to use the native XmlHttpRequest > > >> API? If that version works, then the problem definitely lies with > > >> Prototype, and I'll open a bug for this. > > > >> Cheers, > > >> Andrew > > > >> On Aug 5, 4:30 pm, 0m4r wrote: > > >> > Hi All, > > > >> > I have a strange behavior with a pice of code I wrote using the latest > > >> > prototype release, here it is: > > >> > == > > >> > var debug = $('debug'); > > >> > new Ajax.Request("http://twitter.com/statuses/ > > >> > public_timeline.json", { > > >> > method: 'get', > > >> > onLoading: function(){ > > >> > debug.update('Loading...'); > > >> > }, > > >> > onSuccess: function(transport) { > > >> > debug.update("SUCCESS: " + transport.responseJSON + > > >> ""); > > > >> > }, > > >> > onException: function(transport, exception){ > > >> > debug.update("EXCEPTION: " + exception); > > >> > } > > >> > }); > > >> > == > > > >> > What is happening here is that I'm doing an HTTP OPTION request > > >> > instead of a HTTP GET request and I believe it is because of this: > > >>http://hacks.mozilla.org/2009/07/cross-site-xmlhttprequest-with-cors/ > > >> > but anyway I don't know how to manage/avoid it. I just want to make an > > >> > AJAX request using HTTP GET. > > > >> > Can anyone help me? > > > >> > Many thanks, > > > >> > Omar --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: HTTP OPTION REQUEST with FireFox 3.5
Same error here, Mozilla documentation says that in a cross domain call there are two response headers: OPTIONS and POST Prototype receives the OPTIONS one but the POST is lost. On 16 ago, 18:32, Omar Adobati wrote: > Hi Andrew, > > I'm sorry to be so in late but I was quite busy with my job in the past > days, anyway, here you ca test the same request with both prototypejs > framework and the xmlhttp object: > http://www.adobati.it/labs/test/ > > Let me to know what do you think! > > --- > Omar Adobati > > > > On Thu, Aug 6, 2009 at 15:55, Omar Adobati wrote: > > Sure, > > I will and I will let you to know. > > > Thanks, > > > Omar > > > Sent from Düsseldorf, North Rhine-Westphalia, Germany > > > On Thu, Aug 6, 2009 at 15:48, Andrew Dupont wrote: > > >> Omar, can you try rewriting this code to use the native XmlHttpRequest > >> API? If that version works, then the problem definitely lies with > >> Prototype, and I'll open a bug for this. > > >> Cheers, > >> Andrew > > >> On Aug 5, 4:30 pm, 0m4r wrote: > >> > Hi All, > > >> > I have a strange behavior with a pice of code I wrote using the latest > >> > prototype release, here it is: > >> > == > >> > var debug = $('debug'); > >> > new Ajax.Request("http://twitter.com/statuses/ > >> > public_timeline.json", { > >> > method: 'get', > >> > onLoading: function(){ > >> > debug.update('Loading...'); > >> > }, > >> > onSuccess: function(transport) { > >> > debug.update("SUCCESS: " + transport.responseJSON + > >> ""); > > >> > }, > >> > onException: function(transport, exception){ > >> > debug.update("EXCEPTION: " + exception); > >> > } > >> > }); > >> > == > > >> > What is happening here is that I'm doing an HTTP OPTION request > >> > instead of a HTTP GET request and I believe it is because of this: > >>http://hacks.mozilla.org/2009/07/cross-site-xmlhttprequest-with-cors/ > >> > but anyway I don't know how to manage/avoid it. I just want to make an > >> > AJAX request using HTTP GET. > > >> > Can anyone help me? > > >> > Many thanks, > > >> > Omar --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: HTTP OPTION REQUEST with FireFox 3.5
Hi Andrew, I'm sorry to be so in late but I was quite busy with my job in the past days, anyway, here you ca test the same request with both prototypejs framework and the xmlhttp object: http://www.adobati.it/labs/test/ Let me to know what do you think! --- Omar Adobati On Thu, Aug 6, 2009 at 15:55, Omar Adobati wrote: > Sure, > I will and I will let you to know. > > Thanks, > > Omar > > > Sent from Düsseldorf, North Rhine-Westphalia, Germany > > On Thu, Aug 6, 2009 at 15:48, Andrew Dupont wrote: > >> >> Omar, can you try rewriting this code to use the native XmlHttpRequest >> API? If that version works, then the problem definitely lies with >> Prototype, and I'll open a bug for this. >> >> Cheers, >> Andrew >> >> On Aug 5, 4:30 pm, 0m4r wrote: >> > Hi All, >> > >> > I have a strange behavior with a pice of code I wrote using the latest >> > prototype release, here it is: >> > == >> > var debug = $('debug'); >> > new Ajax.Request("http://twitter.com/statuses/ >> > public_timeline.json", { >> > method: 'get', >> > onLoading: function(){ >> > debug.update('Loading...'); >> > }, >> > onSuccess: function(transport) { >> > debug.update("SUCCESS: " + transport.responseJSON + >> ""); >> > >> > }, >> > onException: function(transport, exception){ >> > debug.update("EXCEPTION: " + exception); >> > } >> > }); >> > == >> > >> > What is happening here is that I'm doing an HTTP OPTION request >> > instead of a HTTP GET request and I believe it is because of this: >> http://hacks.mozilla.org/2009/07/cross-site-xmlhttprequest-with-cors/ >> > but anyway I don't know how to manage/avoid it. I just want to make an >> > AJAX request using HTTP GET. >> > >> > Can anyone help me? >> > >> > Many thanks, >> > >> > Omar >> >> >> > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: HTTP OPTION REQUEST with FireFox 3.5
Sure, I will and I will let you to know. Thanks, Omar Sent from Düsseldorf, North Rhine-Westphalia, Germany On Thu, Aug 6, 2009 at 15:48, Andrew Dupont wrote: > > Omar, can you try rewriting this code to use the native XmlHttpRequest > API? If that version works, then the problem definitely lies with > Prototype, and I'll open a bug for this. > > Cheers, > Andrew > > On Aug 5, 4:30 pm, 0m4r wrote: > > Hi All, > > > > I have a strange behavior with a pice of code I wrote using the latest > > prototype release, here it is: > > == > > var debug = $('debug'); > > new Ajax.Request("http://twitter.com/statuses/ > > public_timeline.json", { > > method: 'get', > > onLoading: function(){ > > debug.update('Loading...'); > > }, > > onSuccess: function(transport) { > > debug.update("SUCCESS: " + transport.responseJSON + > ""); > > > > }, > > onException: function(transport, exception){ > > debug.update("EXCEPTION: " + exception); > > } > > }); > > == > > > > What is happening here is that I'm doing an HTTP OPTION request > > instead of a HTTP GET request and I believe it is because of this: > http://hacks.mozilla.org/2009/07/cross-site-xmlhttprequest-with-cors/ > > but anyway I don't know how to manage/avoid it. I just want to make an > > AJAX request using HTTP GET. > > > > Can anyone help me? > > > > Many thanks, > > > > Omar > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: HTTP OPTION REQUEST with FireFox 3.5
Omar, can you try rewriting this code to use the native XmlHttpRequest API? If that version works, then the problem definitely lies with Prototype, and I'll open a bug for this. Cheers, Andrew On Aug 5, 4:30 pm, 0m4r wrote: > Hi All, > > I have a strange behavior with a pice of code I wrote using the latest > prototype release, here it is: > == > var debug = $('debug'); > new Ajax.Request("http://twitter.com/statuses/ > public_timeline.json", { > method: 'get', > onLoading: function(){ > debug.update('Loading...'); > }, > onSuccess: function(transport) { > debug.update("SUCCESS: " + transport.responseJSON + ""); > > }, > onException: function(transport, exception){ > debug.update("EXCEPTION: " + exception); > } > }); > == > > What is happening here is that I'm doing an HTTP OPTION request > instead of a HTTP GET request and I believe it is because of > this:http://hacks.mozilla.org/2009/07/cross-site-xmlhttprequest-with-cors/ > but anyway I don't know how to manage/avoid it. I just want to make an > AJAX request using HTTP GET. > > Can anyone help me? > > Many thanks, > > Omar --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: HTTP OPTION REQUEST with FireFox 3.5
Yes I know I need to use a proxy to make that call but I did try it and I got the same result... You know what is funny... it works with the internal browser in Eclipse but not with any of the other browsers I've been testing. On Aug 6, 7:27 am, Walter Lee Davis wrote: > Unless you work at Twitter, this will run afoul of the Single Origin > Policy, and you can't do this. (Ajax requests have to stick to the > domain and port that they are run from for their content.) If you > create a simple proxy and run it on your server, then you could > request /mytwitterproxy.php from your server with impunity. > > Walter > > On Aug 5, 2009, at 5:30 PM, 0m4r wrote: > > > > > > > Hi All, > > > I have a strange behavior with a pice of code I wrote using the latest > > prototype release, here it is: > > == > > var debug = $('debug'); > > new Ajax.Request("http://twitter.com/statuses/ > > public_timeline.json", { > > method: 'get', > > onLoading: function(){ > > debug.update('Loading...'); > > }, > > onSuccess: function(transport) { > > debug.update("SUCCESS: " + transport.responseJSON + " >> "); > > }, > > onException: function(transport, exception){ > > debug.update("EXCEPTION: " + exception); > > } > > }); > > == > > > What is happening here is that I'm doing an HTTP OPTION request > > instead of a HTTP GET request and I believe it is because of this: > >http://hacks.mozilla.org/2009/07/cross-site-xmlhttprequest-with-cors/ > > but anyway I don't know how to manage/avoid it. I just want to make an > > AJAX request using HTTP GET. > > > Can anyone help me? > > > Many thanks, > > > Omar --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: HTTP OPTION REQUEST with FireFox 3.5
Walter... The link in his post describes how to do XDR in FF3.5! Alex Mcauley http://www.thevacancymarket.com - Original Message - From: "Walter Lee Davis" To: Sent: Thursday, August 06, 2009 6:27 AM Subject: [Proto-Scripty] Re: HTTP OPTION REQUEST with FireFox 3.5 > > Unless you work at Twitter, this will run afoul of the Single Origin > Policy, and you can't do this. (Ajax requests have to stick to the > domain and port that they are run from for their content.) If you > create a simple proxy and run it on your server, then you could > request /mytwitterproxy.php from your server with impunity. > > Walter > > On Aug 5, 2009, at 5:30 PM, 0m4r wrote: > >> >> Hi All, >> >> I have a strange behavior with a pice of code I wrote using the latest >> prototype release, here it is: >> == >> var debug = $('debug'); >>new Ajax.Request("http://twitter.com/statuses/ >> public_timeline.json", { >> method: 'get', >> onLoading: function(){ >> debug.update('Loading...'); >> }, >> onSuccess: function(transport) { >>debug.update("SUCCESS: " + transport.responseJSON + ">> "); >> }, >> onException: function(transport, exception){ >>debug.update("EXCEPTION: " + exception); >> } >>}); >> == >> >> What is happening here is that I'm doing an HTTP OPTION request >> instead of a HTTP GET request and I believe it is because of this: >> http://hacks.mozilla.org/2009/07/cross-site-xmlhttprequest-with-cors/ >> but anyway I don't know how to manage/avoid it. I just want to make an >> AJAX request using HTTP GET. >> >> Can anyone help me? >> >> Many thanks, >> >> Omar >> >> > > > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: HTTP OPTION REQUEST with FireFox 3.5
Unless you work at Twitter, this will run afoul of the Single Origin Policy, and you can't do this. (Ajax requests have to stick to the domain and port that they are run from for their content.) If you create a simple proxy and run it on your server, then you could request /mytwitterproxy.php from your server with impunity. Walter On Aug 5, 2009, at 5:30 PM, 0m4r wrote: > > Hi All, > > I have a strange behavior with a pice of code I wrote using the latest > prototype release, here it is: > == > var debug = $('debug'); > new Ajax.Request("http://twitter.com/statuses/ > public_timeline.json", { > method: 'get', > onLoading: function(){ > debug.update('Loading...'); > }, > onSuccess: function(transport) { > debug.update("SUCCESS: " + transport.responseJSON + "> "); > }, > onException: function(transport, exception){ > debug.update("EXCEPTION: " + exception); > } > }); > == > > What is happening here is that I'm doing an HTTP OPTION request > instead of a HTTP GET request and I believe it is because of this: > http://hacks.mozilla.org/2009/07/cross-site-xmlhttprequest-with-cors/ > but anyway I don't know how to manage/avoid it. I just want to make an > AJAX request using HTTP GET. > > Can anyone help me? > > Many thanks, > > Omar > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---