我两个月前创建的脚本一次又一次失败了。我尝试过恢复备份文件,但没有更改。这个问题出现在所有使用google函数脚本的网站上,我使用的是.button() .corner()
链接和脚本:
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>
<script src="http://malsup.github.com/jquery.corner.js"></script> 错误:
BlockquoteUncaught异常: TypeError:无法将‘$(“#BuyCredit”)转换为object
在http://www.t-samp.net/credit-shop.php:$(“#BuyCredit”).button () .click(函数(){通过Function.prototype.apply()从第2行调用),http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js中(b,f)第29359列调用: if(cm.apply(b,f)===!1&&a.stopOnFalse)从第2行调用的错误:(cm.apply (b,f)===!1&&a.stopOnFalse)从第2行调用,在(b,c)中调用http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js:d&&(j?a.once||d.push(b ),(!a.once||!e)&&o(b,c));从第2行调用,在(a)中调用http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js:A.fireWith(c,e)中的第19036列,从第2行调用A.fireWith(c,e),在http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js:c.removeEventListener("DOMContentLoaded",B,!1)中调用第28469行in (),e.ready()
我的剧本:
<script>
$(document).ready(function() {
$("#BuyCredit").button().click(function() {
$(".buycr").corner();
$(".buycr").css("display","block");
});
});
</script>我的HTML:
<div class="buycr" data-corner="15px">
<div style="width:280px">Text</div>
</div>
<div style="width:100px">
<span id="HideBox">Zavřít</span>
</div>谢谢你的反馈
发布于 2012-04-12 17:29:25
您正在链接到两个不同版本的jQuery
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>试着摆脱最新的(假设它以前在1.7.2上起作用)。
编辑,因为这不起作用,最好的猜测是,不管#BuyCredit是什么都不在了。这将解释错误Cannot convert '$("#BuyCredit")' to object。
确保页面上有一个#BuyCredit。
https://stackoverflow.com/questions/10128651
复制相似问题