My first question so here it goes.
My goal is to have a simple form post and if everything checks out proceed.
$.post("anotherpage.php", $("#form").serialize(),function(data){
if(data == 'sent'){
alert("True: " + data);
} else{
alert("False: " + data);
}
$("#somediv").text(data);
});
here is 'anotherpage.php'
<?php
echo 'sent';
?>
Here is my problem, '#somediv' shows the word 'sent' but my function fails every time. Also when it does fail when it alerts it looks like this. "False: s..." It makes me think I have some problem up the stream that is effecting this but I don't know what.
console.log(data)with Firebug or Chrome to see what's actually indata.console.log(data.length)and check that it prints "4"console.log(data)andconsole.log(data.length)results: sent and 6??? This is the echo string copied.echo 'sent';