jquery响应是正确的,但错误的选择

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';
}

There is likely whitespace in your return result. This can be solved by trimming the return result

var term = 'jan';

$.ajax(
{
    type : 'POST',
    url  : 'process.php',
    data : 'term=' + term,
    dataType  : 'text',
    timeout   : 600000,
    success   : function(response)
    {
        if (response.trim() == 'hello')
        {
            alert('Correct');
        }
        else
        {
            alert('Wrong');
        }
    }
});