I am at a complete loss here and I need a solution asap! Any help is GREATLY appreciated!!! I have my request going out to a php script that sends a query to my db and then echos the return data into html format. this script works fine when I go to the url in a browser and send the correct params. However, in my ajax request, nothing gets returned?! Here is my code... ------------------------------------------------ function updateData() { url = "http://www.myURL.com/updateData.php?myparams"; new Ajax.Request(url, { method: ''POST'', asynchronus: ''true'', contentType: ''text/html'', onComplete: parseData}); } function parseData(originalRequest) { myResponse = originalRequest.responseText; myDivID.innerHTML += myResponse; } ------------------------------------------------- when I include alerts in parseData to see if there is any content to responseText, it always comes back empty. What am I doing wrong here? Like I said, the php script is working fine, but there seems to be some disconnect happening with the ajax request. BTW, in my php script the headers are set to prevent caching... Please Help!! 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?hl=en -~----------~----~----~----~------~----~------~--~---
Justin Perkins
2008-Jan-30 17:14 UTC
Re: Ajax.Request - nothing in responseText, I need it!!
Try: originalRequest.transport.responseText -justin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Brian Williams
2008-Jan-30 17:22 UTC
Re: Ajax.Request - nothing in responseText, I need it!!
if you have well structure html http://prototypejs.org/api/element/insert should make it almost trivial On Wed, Jan 30, 2008 at 11:57 AM, polomasta <bjoyce-PGNGAmqIy5icqzYg7KEe8g@public.gmane.org> wrote:> > I am at a complete loss here and I need a solution asap! Any help is > GREATLY appreciated!!! I have my request going out to a php script > that sends a query to my db and then echos the return data into html > format. this script works fine when I go to the url in a browser and > send the correct params. > > However, in my ajax request, nothing gets returned?! Here is my > code... > ------------------------------------------------ > function updateData() > { > url = "http://www.myURL.com/updateData.php?myparams"; > new Ajax.Request(url, { > method: ''POST'', > asynchronus: ''true'', > contentType: ''text/html'', > onComplete: parseData}); > } > > function parseData(originalRequest) > { > myResponse = originalRequest.responseText; > > myDivID.innerHTML += myResponse; > > } > ------------------------------------------------- > > when I include alerts in parseData to see if there is any content to > responseText, it always comes back empty. > > What am I doing wrong here? Like I said, the php script is working > fine, but there seems to be some disconnect happening with the ajax > request. > > BTW, in my php script the headers are set to prevent caching... > > Please Help!! 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?hl=en -~----------~----~----~----~------~----~------~--~---
YOU ARE MY HERO!! thanks! works like a charm On Jan 30, 11:14 am, "Justin Perkins" <justinperk...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Try: originalRequest.transport.responseText > > -justin--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---