Reputation: 1359
When I download the 4.0.1 Release Candidate (https://github.com/select2/select2/releases/tag/4.0.1-rc.1) of Select2 and use it, I get a JavaScript error: Uncaught ReferenceError: define is not defined
.
Here I read that it has to do with the AMD loader (which I don't use): https://groups.google.com/forum/#!topic/select2/PCQpiJxIIXQ
When I don't use the jquery.select2.js from the RC, but the select2.min.js from the current master: https://raw.githubusercontent.com/select2/select2/master/dist/js/select2.min.js
it works!
But I'm curious what I overlook here. Most likely I'm doing something wrong myself.
Edit - code example:
in the head:
<script language='Javascript' src='scripts/jquery-1.9.1.min.js'></script>
<script language='Javascript' src='scripts/jquery.select2.js'></script>
in the body:
<script type="text/javascript">
$(document).ready(function(){
$('#id_of_select').select2({
tags: "true",
placeholder: "",
allowClear: true,
tokenSeparators: [',', ' ']
});
});
</script>
<select multiple id="id_of_select" name="name[]">
<option value="1" selected="">Option 1</option>
<option value="2" selected="">Option 2</option>
<option value="5">Option 3</option>
</select>
Upvotes: 12
Views: 7535
Reputation: 1359
Ok, my bad it is.. in the folder structure of the select2 package there are several folders including:
dist
src
I used the javascript from the src
folder.. But it seems the right files are in the dist
folder.
Upvotes: 20