Here is my code.
$("#selected").droppable({
drop: function() {
total = total + 1;
alert('total : ' + total);
}
});
I am getting following error:
$("#selected").droppable is not a function.
What should be the solution for this?
You likely have one of the following issues with respect to your <script>
tags:
jQuery
object)The third is a very common overlooked issue, where all of the plugins that jQuery UI add get blown away by another jQuery include overwriting the jQuery
object.
Just a couple of standard things to check:
1) Have you included jquery.js & jqueryui.js before this script?
2) is there a syntax error before this line?
3) Are you doing this inside a $(document).ready(...) or equivalent (shouldn't necessarily be a problem, but just in case)
Adding JQuery scripts before Angular worked for me. Dragdrop documentation lacks this piece of information.
My index.html ended up like this:
<script src="bower_components/jquery/dist/jquery.js"></script>
<script src="bower_components/jquery-ui/jquery-ui.js"></script>
<script src="bower_components/angular/angular.js"></script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With