I think this is just an obvious problem that I can't spot because I've been staring at code too long today. I have this callback as part of a JQuery POST:
function(data){
if(data == 'yes') {
$('div.done').show();
} else if(data != 'yes') {
$('div.error').show();
alert(data);
}
});
I get the error div shown, yet in the alert all I get is yes. Anyone got any pointers (as I said, I imagine it's some really obvious mistake that I've missed).
Thanks
alert(data.toSource())datahas no whitespace at it's begin/end? try addingdata = data.replace(/^\s+|\s+$/, '');before if statement.javascript:alert(data.toSource())in the URL bar?Object.toStringis non-standard and I told you to run it in firefox which does have it. what exactly does "can't seem to get that to work" mean?