javascript - Using Select2 get error - "Error: No select2/compat/query" -


i attempting use select2 library in site leverage placecomplete (following it's rather simple configuration steps here), when run code strange error -

error: no select2/compat/query`

i've tried googling , seems no 1 else has encountered this?

my code in nutshell is,

loading files...

<link href="scripts/select2/dist/css/select2.min.css" rel="stylesheet" /> <script src="scripts/select2/dist/js/select2.min.js"></script> <script src="scripts/jquery.placecomplete.js">//<![cdata[//]]></script> 

tagging input element in body...

<input id="example123" class="example123" type="text" /> 

in document.ready function, calling following code...

$('#example123').placecomplete({}); 

and thats throws error.

any ideas im going wrong, , error means?

you running 2 issues here, both of can fixed.

  1. select2 4.0.0 no longer supports query option in slimmed down, standard build. must included in full build (select2.full.js) handled through backwards compatibility module.

  2. you using placecomplete , depends on older version of select2. looks select2 3.5.2+ can work, can tell options using, cannot work select2 4.0.0. there open ticket placecomplete.


Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -