Is there any idea why the code below keeps alerting as wrong although the response comes back as hello?
It should alert as correct!
Tnanks
JQUERY
var term = 'jan';
$.ajax(
{
type : 'POST',
url : 'process.php',
data : 'term=' + term,
dataType : 'text',
timeout : 600000,
success : function(response)
{
if (response == 'hello')
{
alert('Correct');
}
else
{
alert('Wrong');
}
}
});
PHP
if ($_POST['term'] == 'jan')
{
echo 'hello';
}
else
{
echo 'noooo';
}