I have an ajax script that calls a php file.
The php file echos \"yes\" or \"no\", I want to use the strings to do logical comparisons.
In the javascript,
In my case I solved this problem by removing spaces between two php blocks in same php file ( "...? > < ?php
..." ) which it requires by require_once() method.
*this space might appear in the XHTTP responce*
--OR--
you can send your data as JSON Object from the server script (php) , for this you can use json_encode()
. for the client side (javascript) you may use eval(this.responce)
.