I’m trying to complete my website with some java’s plugin, I’m on Symfony 4 and I use the CDN bootstrap twitter.
When I put the select2 plugin into the templates all is working properly, the select2 plugin does apply correctly.
However I don’t want to load select2 directly from the templates I want to run it from app.js
but it didn’t work properly, the select2 plugin is activated but it’s weird, I’ll show you the result below.
There is my app.js code:
let $ = require('jquery');
require('../css/app.css');
require('select2');
$('select').select2();
console.log('Hello Webpack Encore! Edit me in assets/js/app.js');
I’m sorry for my bad English, I’ll thank you all for reading my post to the end!
2
Answers
You need to add 3 of the following references
Try this select2 cdn example – https://bbbootstrap.com/snippets/select2-option-cdn-31353331