Hi, I am using Ajax.request object very frequently. I am using following code to send a request to servlet which is running on localhost URL = ''http://localhost:8080/AT/jsonservlet?option=emplist''; new Ajax.Request(URL, { method: ''get'', onException: function(transport, ex){ for (var exp in ex){ alert(exp +" : "+ex[exp]); } }, onSuccess: function(transport) { .... It is generating error on send request "Component returned failure code: 0x80070057(NS_ERROR_ILLEGAL_VALUE)" though this works fine with IE. Any suggestion to make it work in FF. - R --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi Ranjan, You''re most probably breaking the Same Origin Policy: http://en.wikipedia.org/wiki/Same_origin_policy i.e. for this to work, the page triggering the request must be on the same port. Best, Tobie --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi Tobie, Thanks for your reply. The page making this request also in 8080 port but in a different URL i.e. http://localhost:8080/AT/htmls/jsonemployee.html Based on "Same Origin Policy", I also change page location to http://localhost:8080/AT/jsonemployee.html so that servlet and html page are in same URL. But still I get the same error. regards, Ranjan On Feb 23, 12:58 pm, "tobie" <tobie.lan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi Ranjan, > > You''re most probably breaking the Same Origin Policy:http://en.wikipedia.org/wiki/Same_origin_policy > > i.e. for this to work, the page triggering the request must be on the > same port. > > Best, > > Tobie--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
SOP doesn''t specify that the requester and requested page should share the same url... so you definitely didn''t need to go that far. You''ll have to post more code if you want more help ;-) Tobie --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi, I could able to fix this issue. I learned from mozilla site that "the setRequestHeader must be called only after an open() call." I am using prototype.js to invoke url, I just commented setRequestHeader()method there and it started working. Though I need to find out where exactly I need to place setRequestHeader method. If anybody finds a better solution, please update me and it will save me from debugging more and spending time on the same :) regards, Ranjan On Feb 23, 1:33 pm, "Ranjan" <ranjan.bai...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi Tobie, > Thanks for your reply. The page making this request also in > 8080 port but in a different URL i.e. > > http://localhost:8080/AT/htmls/jsonemployee.html > > Based on "Same Origin Policy", I also change page location tohttp://localhost:8080/AT/jsonemployee.htmlso that servlet and html > page are in same URL. > But still I get the same error. > > regards, > Ranjan > > On Feb 23, 12:58 pm, "tobie" <tobie.lan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi Ranjan, > > > You''re most probably breaking the Same Origin Policy:http://en.wikipedia.org/wiki/Same_origin_policy > > > i.e. for this to work, the page triggering the request must be on the > > same port. > > > Best, > > > Tobie--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Sorry to bother again. I just googled the error and I found out that the problem is with extending prototype.js by json.js. I had also same sort of problem rico.js when used together with prototype.js I just got the forum link that explains more detail http://www.ruby-forum.com/topic/96723 On Feb 23, 1:59 pm, "Ranjan" <ranjan.bai...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > I could able to fix this issue. I learned from mozilla site that > "the setRequestHeader must be called only after an open() call." I am > using prototype.js to invoke url, I just commented > setRequestHeader()method there and it started working. Though I need > to find out where exactly I need to place setRequestHeader method. > > If anybody finds a better solution, please update me and it will save > me from debugging more and spending time on the same :) > > regards, > Ranjan > > On Feb 23, 1:33 pm, "Ranjan" <ranjan.bai...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi Tobie, > > Thanks for your reply. The page making this request also in > > 8080 port but in a different URL i.e. > > >http://localhost:8080/AT/htmls/jsonemployee.html > > > Based on "Same Origin Policy", I also change page location tohttp://localhost:8080/AT/jsonemployee.htmlsothat servlet and html > > page are in same URL. > > But still I get the same error. > > > regards, > > Ranjan > > > On Feb 23, 12:58 pm, "tobie" <tobie.lan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hi Ranjan, > > > > You''re most probably breaking the Same Origin Policy:http://en.wikipedia.org/wiki/Same_origin_policy > > > > i.e. for this to work, the page triggering the request must be on the > > > same port. > > > > Best, > > > > Tobie--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---