weixin_33695450 2014-08-04 06:00 采纳率: 0%
浏览 114

.done()jQuery无法正常工作

Im using the below code for a ajax call

var getRequest = $.ajax({
    type: 'GET',
    url: Url,
    async: false,
    dataType: "text",
    complete: function () {
        $('#loading').hide();
    }
});

the request is getting complete and data is also withdrawn after the data is recieved the following:

getRequest.done(function (dataDb) {
    if (dataDb) {
        alert('dataDb: ' + dataDb);

    }
});

getRequest.fail(function (jqXHR, textStatus, error) {
    alert('data error within getUsersRequest ' + textStatus + ' : ' + error);
});

I'm recieving a error that getRequest.done(function(dataDb) or getRequest.fail(function(jqXHR, textStatus, error) is not a function.

  • 写回答

3条回答 默认 最新

  • weixin_33738555 2014-08-04 06:05
    关注

    It is because your JQuery version is too old.

    You can use success if you are not willing to upgrade the latest version of JQuery.

    success: function(dataDb) {
    
        }
    
    评论

报告相同问题?