MAO-EYE 2012-10-01 19:18 采纳率: 66.7%
浏览 4

AJAX发送错误

I have a strange problem with jQuery ajax function in my script.

my problem only happen on my friend computer but i don't suffer from any thing on my computer.

I tried to make error function property alert error contents but something strange happened

$.ajax({
    url : EXECUTION_URL + 'ajax/users.php',
    type : 'POST',
    error : function( err1, err2, err3 ) {
        alert(err2 + ' : ' + err3 + ' , ' + err1.responseText);
    },
    data : {
        'value' : 'val',
        'type' : 'email'
    },
    success : function( data, statusText, xhr ) {
        alert(data)
    },
});

the important line is :
alert(err2 + ' : ' + err3 + ' , '+ err1.responseText)
but it fire only : 'error: , ' .
why this happen ? and how i can know the error of sending this request

  • 写回答

3条回答 默认 最新

  • weixin_33688840 2012-10-01 19:22
    关注

    Probably, the objects you're trying to alert can't be converted to string (for the alert text). Try using a console.log. Then you'll know what's happening and you'll be able to fix the problem.

    评论

报告相同问题?