【问题标题】:jquery.min and ajax Uncaught SyntaxError: Unexpected tokenjquery.min 和 ajax Uncaught SyntaxError: Unexpected token
【发布时间】:2012-02-24 19:44:41
【问题描述】:

我在网站上使用 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);

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

【问题讨论】:

    标签: jquery ajax conflict


    【解决方案1】:

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

    【讨论】:

    • 感谢您的重播....但我真的尝试了一切....smartajax 是我唯一可以使用的(我使用的是社交引擎 v3)。
    猜你喜欢
    • 2016-10-30
    • 1970-01-01
    • 2016-08-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-29
    相关资源
    最近更新 更多