Hello All --- I am using the AJAX Object to send form data to a PHP page. In IE, I am able to get a call back thru the showResponse(); However, in Firefox, the callback never gets executed. Here is my code: function showResponse() { alert(''Thank You. Your information has been sent''); } function processForm() { var url = "sendEmail.php"; var name = $F(''name''); var email = $F(''email''); var phone = $F(''phone''); var comments = $F(''comments''); var pars = ''name=''+ name + ''&email='' + email + ''&phone='' + phone + ''&comments='' + comments; var myAjax = new Ajax.Request(url, {method: ''post'', parameters: pars, onComplete: showResponse}); return false; } Any ideas as to why showResponse() is not being called in Firefox? Thanks for any and all replies. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Eric Harrison
2007-Mar-14 08:40 UTC
Re: showResponse() Callback not being called in Firefox
Umm... what version of Firefox? I just ran it in Firefox 2.0.0.1 and it worked perfectly. The syntax also looks correct so I''m nearly 100% certain it will work in at least 1.5 and up. Do you have Firebug (http://getfirebug.com) installed? If not, please do yourself a favor and go get it. It''ll allow you to debug these quirky XMLHttpRequests with ease. -E On 3/13/07, SL <sleblang-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hello All --- > > I am using the AJAX Object to send form data to a PHP page. In IE, I > am able to get a call back thru the showResponse(); However, in > Firefox, the callback never gets executed. Here is my code: > > function showResponse() > { > alert(''Thank You. Your information has been sent''); > } > > function processForm() > { > var url = "sendEmail.php"; > var name = $F(''name''); > var email = $F(''email''); > var phone = $F(''phone''); > var comments = $F(''comments''); > var pars = ''name=''+ name + ''&email='' + email + ''&phone='' + phone + > ''&comments='' + comments; > var myAjax = new Ajax.Request(url, {method: ''post'', parameters: > pars, onComplete: showResponse}); > return false; > } > > Any ideas as to why showResponse() is not being called in Firefox? > Thanks for any and all replies. > > > > >-- Eric Ryan Harrison --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 13 Mar., 17:29, "SL" <slebl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello All --- > > I am using the AJAX Object to send form data to a PHP page. In IE, I > am able to get a call back thru the showResponse(); However, in > Firefox, the callback never gets executed. Here is my code: > > function showResponse() > { > alert(''Thank You. Your information has been sent''); > > } > > function processForm() > { > var url = "sendEmail.php"; > var name = $F(''name''); > var email = $F(''email''); > var phone = $F(''phone''); > var comments = $F(''comments''); > var pars = ''name=''+ name + ''&email='' + email + ''&phone='' + phone + > ''&comments='' + comments; > var myAjax = new Ajax.Request(url, {method: ''post'', parameters: > pars, onComplete: showResponse}); > return false; > > } > > Any ideas as to why showResponse() is not being called in Firefox? > Thanks for any and all replies.I have a similar problem with Ajax.Updater which is working in prototype1.4, but broke in 1.5/.1, I''m using FF2.0.0.3 My code looks almost identical to yours : new Ajax.Updater(detailId, url, { method: ''get'', parameters: pars, onFailure: reportError, onComplete: toggleMainDetail(''main''), evalScripts: true }); This works in IE7 and prototype 1.5.1 *J* --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
David Dashifen Kees
2007-May-11 13:07 UTC
Re: showResponse() Callback not being called in Firefox
I''m not sure if you can pass parameters to your onComplete function the way you''ve written it below. What you''ve done is evaluated that function and then referenced the return value when the Ajax.Updater object is complete. Try changing your code to something like this and let us know if it works then: onComplete: function() { toggleMainDetail(''main''); }, By doing this, when the Ajax.Updater object is complete, it will call the anonymous function which, in turn, calls toggleMainDetail(). - Dash - jnie wrote:> On 13 Mar., 17:29, "SL" <slebl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> Hello All --- >> >> I am using the AJAX Object to send form data to a PHP page. In IE, I >> am able to get a call back thru the showResponse(); However, in >> Firefox, the callback never gets executed. Here is my code: >> >> function showResponse() >> { >> alert(''Thank You. Your information has been sent''); >> >> } >> >> function processForm() >> { >> var url = "sendEmail.php"; >> var name = $F(''name''); >> var email = $F(''email''); >> var phone = $F(''phone''); >> var comments = $F(''comments''); >> var pars = ''name=''+ name + ''&email='' + email + ''&phone='' + phone + >> ''&comments='' + comments; >> var myAjax = new Ajax.Request(url, {method: ''post'', parameters: >> pars, onComplete: showResponse}); >> return false; >> >> } >> >> Any ideas as to why showResponse() is not being called in Firefox? >> Thanks for any and all replies. >> > > I have a similar problem with Ajax.Updater which is working in > prototype1.4, but broke in 1.5/.1, I''m using FF2.0.0.3 > > My code looks almost identical to yours : > new Ajax.Updater(detailId, > url, > { method: ''get'', > parameters: pars, > onFailure: reportError, > onComplete: toggleMainDetail(''main''), > evalScripts: true > }); > > This works in IE7 and prototype 1.5.1 > > *J* > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---