I am trying to view a particular header from the request object when using Ajax.Updater var myAjax = new Ajax.Updater(''item'', url, {method: get, onFailure: failed}); function failed(request) { alert(request.header(''My-Header'')); } That doesn''t work even though the documentation seems to indicate it should. If I put an alert inside the header(name) function on Ajax.Request it gets fired as part of its own completion but if I try and call it like above the alert doesn''t fire. So it almost looks like it is not finding the function I am guessing I am just not interpreting the documentation correctly but I do need to get the values from the response headers. S. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Succhan wrote:> If I put an alert inside the header(name) function on Ajax.Request it > gets fired as part of its own completion but if I try and call it like > above the alert doesn''t fire. So it almost looks like it is not finding > the functionAre you sure it''s the alert that''s not firing? Or is it your onFailure function? My guess is it''s the latter. -- Michael Peters Developer Plus Three, LP --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I just watched a screencast on how to use Firebug for debugging. So I gave that a go. Trying to run request.header(''My-Header-Name'') throws an exception that is caught, "TypeError: request.header is not a function" That confuses me as the documentation looks like that should return the contents of the header. I remembered a book I read that returned contents from headers by using the native function getResponseHeader(name) on the XMLHttpRequest Object. So I am using that and getting what I need. Thanks. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 11/2/06, Succhan <succhan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I just watched a screencast on how to use Firebug for debugging. So I > gave that a go. > > Trying to run request.header(''My-Header-Name'') throws an exception that > is caught, "TypeError: request.header is not a function"I would have used Firebug to set a breakpoint and inspect the "request" argument. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---