jquery.min和ajax Uncaught SyntaxError:意外的令牌

时间:2012-02-24 19:44:42

标签: jquery ajax conflict

我在网站上使用ajax脚本(smartajax)来加载页面, 但出于某种原因,它会破坏某些页面。 firebug在jquery.min v 1.5.2中说这个函数有问题:

noop: function(){}, globalEval: function(a) { if (a && i.test(a)) {var b = c.head || c.getElementsByTagName("head")[0] || c.documentElement, e = c.createElement("script");d.support.scriptEval()? e.appendChild(c.createTextNode(a)) : e.text = a,b.insertBefore(e,b.firstChild), b.removeChild(e)}},nodeName: function (a, b) {return a.nodeName && a.nodeName.toUpperCase() === b.toUpperCase()}, 当我删除这个功能页面不粉碎,但也ajax不能正常工作???

以及我如何调用ajax:

SmartAjax_load('js/smartajax/', function(){SmartAjax.isDebug = false;SmartAjax.setOptions({cache: false,reload:false,containers[{selector: '#container'}],before:function({jQuery('#ajaxloader').show();SmartAjax.proceed();},done:function({jQuery('#ajaxloader').hide();}});SmartAjax.bind('a[rel=zcommunity]');}, true);

请问错误或想法在哪里? 谢谢

1 个答案:

答案 0 :(得分:0)

听起来像jQuery 1.5.2和SmartAjax之间的不兼容。您可以尝试升级到jQuery 1.7.1,但就个人而言,我只会使用内置的jQuery AJAXjQuery .load()函数。你有必要使用SmartAjax吗?

相关问题