I met a problem with current version(4.0.0 stable).
I've included it to my Rails project, but it doesn't work.
Chrome says: Uncaught TypeError: this.$selection.on is not a function.
Safari says: TypeError: undefined is not a function (evaluating 'this.$selection.on("focus",function(a){b.trigger("focus",a)})')
I tried both including local files and files from cdn. And I tried with easiest example:
<script>
$(document).ready(function() {
$(".js-example-basic-single").select2();
});
</script>
<select class="js-example-basic-single">
<option value="AL">Alabama</option>
<option value="WY">Wyoming</option>
</select>
Since this is Google's only hit for
"this.$selection.on is not a function"
In case anyone finds this page looking for a solution, the answer is to use a newer jQuery.
Most helpful comment
Since this is Google's only hit for
"this.$selection.on is not a function"In case anyone finds this page looking for a solution, the answer is to use a newer jQuery.