Chr*_*isP 7 jquery parse-error
当我升级到jQuery 1.5.1(或1.5)时ajax(),我站点中的所有调用都会在错误选项函数中生成"parserror".还有一个脚本错误
Uncaught SyntaxError: Unexpected token : jquery-1.5.1.min.js:16
Run Code Online (Sandbox Code Playgroud)
使用1.4.4,该站点一直在运行w/o错误.这是来自其中一个ajax()调用的代码.
$.ajax({
url: '/CustomerGroup/Get',
type: 'POST',
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: function (grp) {
if (grp != null) {
clear();
group = grp;
load(grp);
} else{
showError(
'Customer Group',
'Whoops, error getting customer group information. Please contact support@myorg.com and include your username and date/time of the error.'
);
}
},
error: function (x,s,e) {
showError(
'Customer Group',
'Whoops, error getting customer group information. Please contact support@myorg.com and include your username and date/time of the error.'
);
}
});
Run Code Online (Sandbox Code Playgroud)
经过大量研究后,我无法弄清楚错误发生的原因.任何见解都表示赞赏.
编辑:使用完整版的jQuery我得到以下内容:
Uncaught SyntaxError: Unexpected token :
d.d.extend.globalEvaljquery-1.5.1.js:16
d.ajaxSetup.converters.text scriptjquery-1.5.1.js:16
bJjquery-1.5.1.js:16
wjquery-1.5.1.js:16
d.support.ajax.d.ajaxTransport.send.cjquery-1.5.1.js:16
Run Code Online (Sandbox Code Playgroud)
和是我正在使用jquery.validate.
这是jQuery验证插件中的一个错误.两天前我遇到了同样的问题.正如它在jQuery验证插件网站上所说,1.7版本与jQuery 1.5.x 不兼容.
您需要从Jörn的github页面安装较新版本的validate.
| 归档时间: |
|
| 查看次数: |
9661 次 |
| 最近记录: |