TypeError:$ .ajax不是函数 [英] TypeError: $.ajax is not a function

查看:100
本文介绍了TypeError:$ .ajax不是函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到,TypeError:$ .ajax不是一个函数,在下面的代码的firebug的控制台中。

如何解决这个问题?

i get,TypeError: $.ajax is not a function, in the console of the firebug for the code below.
How to solve this?

function cropImage() {
    debugger;
    var x = 10;
    var y = 30;
    var w = 50;
    var h = 80;
    $jQuery.ajax({
        type: 'POST',
        contentType: "application/json; charset=utf-8",
        dataType: 'json',
        url: 'WebService.asmx/ImageCrop',
        data: "{'x':'" + x + "','x':'" + y + "','w':'" + w + "','h':'" + h + "'}",
        async: false,
        success: function (response) {

            alert("Record saved successfully in database");
        },
        error: function () {

            alert("some problem in saving data");
        }
    });
}

推荐答案

.ajax不是一个函数,在下面代码的firebug控制台中。

如何解决这个问题?

.ajax is not a function, in the console of the firebug for the code below.
How to solve this?
function cropImage() {
    debugger;
    var x = 10;
    var y = 30;
    var w = 50;
    var h = 80;


jQuery。 ajax({
type:' POST'
contentType: application / json; charset = utf-8
dataType:' json'
url:' WebService.asmx / ImageCrop'
data: {' x':' + x + ','x':' + y + ','w':' + w + ','h':' + h + '}
async false
成功:函数(响应){

alert ( 记录在数据库中成功保存);
},
错误:function(){

alert( 保存数据时出现一些问题);
}
});
}
jQuery.ajax({ type: 'POST', contentType: "application/json; charset=utf-8", dataType: 'json', url: 'WebService.asmx/ImageCrop', data: "{'x':'" + x + "','x':'" + y + "','w':'" + w + "','h':'" + h + "'}", async: false, success: function (response) { alert("Record saved successfully in database"); }, error: function () { alert("some problem in saving data"); } }); }


代码中存在语法问题。



要么写 jQuery
There is syntax problem in the code.

Either write jQuery or


这篇关于TypeError:$ .ajax不是函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆