admin管理员组

文章数量:1395424

I am trying to use the blockUI jQuery Plugin. I am including the libraries as such;

<script src=".blockUI.1.33.js"></script>
<script src="//ajax.googleapis/ajax/libs/jquery/1.10.2/jquery.min.js"></script>

However Chrome is showing a TypeError

Uncaught TypeError: Object [object Object] has no method 'blockUI' 

I have tried $.blockUI and $.fn.blockUI without success!

Thanks

Edit: I am calling the blockUI code from a function, which is triggered from a button click;

$(function () {
   $('#btnAddIssue').click(function(){
   $.blockUI();
 )};
)};

I am trying to use the blockUI jQuery Plugin. I am including the libraries as such;

<script src="http://malsup./jquery/block/jquery.blockUI.1.33.js"></script>
<script src="//ajax.googleapis./ajax/libs/jquery/1.10.2/jquery.min.js"></script>

However Chrome is showing a TypeError

Uncaught TypeError: Object [object Object] has no method 'blockUI' 

I have tried $.blockUI and $.fn.blockUI without success!

Thanks

Edit: I am calling the blockUI code from a function, which is triggered from a button click;

$(function () {
   $('#btnAddIssue').click(function(){
   $.blockUI();
 )};
)};
Share Improve this question edited Feb 10, 2014 at 13:59 Jake Evans asked Feb 10, 2014 at 13:44 Jake EvansJake Evans 1,0486 gold badges14 silver badges34 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 5

change the order of scripts, because jquery.blockUI.1.33.js which depends on the jquery.min.js

<script src="//ajax.googleapis./ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://malsup./jquery/block/jquery.blockUI.1.33.js"></script>

You have syntax errors in your script,

$(function () {
   $('#btnAddIssue').click(function(){
   $.blockUI();
 )}; //--------------> Improper closing  change it })
)}; //----------------> Improper closing change it })

Fixed:

$(function () {
    $('#btnAddIssue').click(function () {
        $.blockUI();
    });
});

JSFiddle

Found the issue, I had included the jQuery library twice.. oops :)

本文标签: javascriptBlockUIUncaught TypeError Object object Object has no method 39blockUI39Stack Overflow