user1329752
user1329752

Reputation: 1

jquery-ui broken

scripts that i created two months ago all at once didn´t work. I have tried restore backup files, but no changes. This problem appears on all websites, that use scripts from google apis Functions, that i use are .button() .corner()

Links and scripts:

<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>  

Errors:

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

My script:

<script>
    $(document).ready(function() {
      $("#BuyCredit").button().click(function() {
        $(".buycr").corner();
        $(".buycr").css("display","block");  
      }); 
    });
  </script>

My 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>

Thanks for any feedback

Upvotes: 0

Views: 916

Answers (1)

idrumgood
idrumgood

Reputation: 4934

You're linking to two different versions of 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>

Try getting rid of the latest one (assuming it worked before on 1.7.2).

[edit] Since that didn't work, best guess is that whatever #BuyCredit was isn't there anymore. That would explain the error Cannot convert '$("#BuyCredit")' to object.

Make sure that there is a #BuyCredit on your page.

Upvotes: 2

Related Questions