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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.