Malformed Ajax response

software development

#1

Hi,

I’m using prototype on my Dreamhost account to perform an ajax request. However the response data contains the entire call back file data, and not what is simply echoed by the call back php script.
The setup works great on my local php/apache setup but not on dreamhost. is it a transport header issue?

Any ideas?? Thanks!


#2

Hi, after a year doing entirely different things Im back to working out this darn issue on dreamhost. I’m still trying to figure out why my prototype transport is returning the php code and not what the php actually echo’s…

Any idea?!


#3

what’s the filename of your php script? my first guess is that the server doesn’t know it’s supposed to run it as php.

track7 - my dream-hosted site


#4

Without seeing both the way you’re calling the secondary url from your client-viewable page, and insuring that said php page is executing properly, it’s difficult to offer any input.

The first thing I would try is outputting the entire url string you’re calling into a div on the client page, then copy/paste it into a new browser window to make sure it’s executing like you think it is.

This was already suggested in this thread but it bears repeating. If you’re seeing the source code, it would suggest that php isn’t parsing the document.

I love AJAX and use it all the time. I chose to respond in order to make 2 suggestions.

  1. The Firebug plugin for Firefox is awesome for troubleshooting AJAX
  2. Discard prototype.js and start using jQuery.

I have been working with asynchronous stuff for years and have experimented with every technology I’ve been made aware of that focuses on it. After being hesitant to use jQuery initially, I’ve come to decide that it’s one of the greatest recent inventions and will revolutionize web development.

In fact it makes things so easy that I sometimes act like a crabby old man regarding people who use it now. “…back in my day… we had to have a deep understanding of javascript… damned kids!!”