2012-04-12 69 views
0

兩個月前我創建的腳本一次都沒有工作。 我已嘗試恢復備份文件,但沒有更改。出現在所有網站 此問題,從谷歌在使用腳本API的 功能,即我用的都是.button().corner()jquery-ui broken

鏈接和腳本:

<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 exception: TypeError: Cannot convert '$("#BuyCredit")' to object

Error thrown at line 3, column 6 in() in http://www.t-samp.net/credit-shop.php : $("#BuyCredit").button().click(function() { called via Function.prototype.apply() from line 2, column 29359 in (b, f) in http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js : if(c[m].apply(b,f)===!1&&a.stopOnFalse) called from line 2, column 30902 in (b, c) in http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js : d&&(j?a.once||d.push([b,c]):(!a.once||!e)&&o(b,c)); called from line 2, column 19036 in (a) in http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js : A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready") called from line 2, column 28469 in() in http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js : c.removeEventListener("DOMContentLoaded",B,!1),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> 

感謝您的任何反饋

+0

其中是ID爲「BuyCredit」的div?錯誤是$('#BuyCredit')沒有返回任何項 – 2012-04-12 17:30:08

回答

2

你鏈接到兩個不同版本的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

+0

我嘗試刪除第一個腳本,之後,第二個腳本並將版本號更改爲1.6和1.5。但沒有變化:( – user1329752 2012-04-12 17:39:00