weixin_33701251 2016-02-05 17:07 采纳率: 0%
浏览 26

Ajax $ .ajax不是函数

I have a jQuery AJAX call that does this:

function testIndustry() {
    $.ajax({
        type: "GET",
        async: false,
        url: "URL INSERTED HERE",
        contentType: "application/json",
        dataType: 'jsonp',
        success: function(dataJsonP) {
            if (dataJsonP.industry.indexOf('Manufacturing') >= 0){
                //do something
            }
        }
    });
}

But I keep getting this error

TypeError: $.ajax is not a function (in function testIndustry, line 6, col 5)

I read up on StackOverflow and seems like that usually happens when AJAX function is called like this

$.ajax()({});

with an extra pair of opening and closing brackets, which I am not using. Any help is much appreciated.

  • 写回答

0条回答 默认 最新

    报告相同问题?