jQuery 1.5.1中断了所有ajax()调用

编程入门 行业动态 更新时间:2024-10-18 03:28:51
本文介绍了jQuery 1.5.1中断了所有ajax()调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

当我升级到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.

使用完整版的jQu​​ery,我得到以下信息:

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()调用

本文发布于:2023-11-07 10:49:41,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1566251.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:jQuery   ajax

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!