当我升级到jQuery 1.5.1(或1.5)时,我站点中的所有ajax()调用都会在错误选项功能中产生"parserror".还有一个脚本错误
When I upgrade to jQuery 1.5.1 (or 1.5) all of the ajax() calls in my site produce a "parserror" in the error option function. There is also a script error
Uncaught SyntaxError: Unexpected token : jquery-1.5.1.min.js:16该网站使用1.4.4运行时未出现错误.这是来自ajax()调用之一的代码.
The site has been running w/o errors using 1.4.4. Here is code from one of the ajax() calls.
$.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 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 and include your username and date/time of the error.' ); } });经过大量研究,我无法弄清楚为什么会发生错误.任何见解都表示赞赏.
After much research I can not figure out why the error is occurring. Any insights appreciated.
使用完整版的jQuery,我得到以下信息:
EDITED: With the full version of jQuery I get the following:
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是的,我正在使用jquery.validate.
and YES I am using jquery.validate.
推荐答案这是 jQuery验证插件.我两天前遇到了完全相同的问题.就像在jQuery验证插件网站上所说的那样,1.7版与jQuery 1.5.x 不兼容.
This is a bug in the jQuery validation plugin. I hit the exact same problem two days ago. As it says on the jQuery validation plugin site, version 1.7 is not compatible with jQuery 1.5.x.
您需要从Jörn的github页面安装新版本的validate .
You need to install the newer version of validate from Jörn's github page.
更多推荐
jQuery 1.5.1中断了所有ajax()调用
发布评论