jQuery 1.5.1打破了所有ajax()调用

当我升级到jQuery 1.5.1(或1.5)时,我站点中的所有ajax()调用都会在错误选项函数中生成“parserror”。 还有一个脚本错误

 Uncaught SyntaxError: Unexpected token : jquery-1.5.1.min.js:16 

使用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.' ); } }); 

经过大量研究后,我无法弄清楚错误发生的原因。 任何见解都表示赞赏。

编辑:使用完整版的jQu​​ery我得到以下内容:

 Uncaught SyntaxError: Unexpected token : ddextend.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 

和是我正在使用jquery.validate。

这是jQueryvalidation插件中的一个错误。 两天前我遇到了同样的问题。 正如它在jQueryvalidation插件网站上所说,1.7版与jQuery 1.5.x 兼容。

您需要从Jörn的github页面安装较新版本的validate 。

见http://bugs.jquery.com/ticket/8302

并尝试在您的代码中使用dataType: 'text json'