Jump to content

ajax response question


Goose

Recommended Posts

My sites that use AJAX work great and in ordinary browsers I do not see this, but with the Web Developer add-on for firefox I get an error with my AJAX responses. This is the error:

 

Error: syntax error

Source File: http://localhost/chat/ajax.php?action=join_room&room=Default&uid=1

1^

 

Basically if the AJAX response is 1 then the user successfully joined the channel. Is there a different way I should be returning my PHP result to JavaScript? In my php code I am simply doing this echo '1'; and in my JavaScript I am doing something like if(reponse == '1'){ ...

 

If anyone has any advice, I would much appreciate it.

 

Edit: Tried to make my explanation more clear.

Link to comment
https://forums.phpfreaks.com/topic/47516-ajax-response-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.