KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am new to require js, and the problem is I don't really understand how to load jQuery plugins. I would like to load multiple plugins but I already have problems with the first one, with the chose plugin js //site full url var siteUrl = window.location.protocol+"//"+window.location.host + "/"; requirejs.config({ baseUrl: siteUrl + "assets/js", paths: { "jquery": "libs/jquery", "jquery-ui": "libs/jquery-ui", "bootstrap": "libs/bootstrap", "scripts": "scripts", "plugins": "plugins", }, }); requirejs(['jquery', 'jquery-ui', 'bootstrap', 'plugins/chosen'], function($, chosen){ $('.chzn-select').chosen(); }); my test html <select data-placeholder="Choose a country..." style="width:350px;" class="chzn-select"> <option value="">Test</option> <option value="">Test</option> <option value="">Test</option> </select> and when I try to load it I get the following error TypeError: $ is not a function ...tion(){"in"==self.hoverState&&self.show()},self.options.delay.show),void 0):self... bootstrap.js (line 6) TypeError: $(...).chosen is not a function $('.chzn-select').chosen(); Could someone please point out what I am doing wrong?
Tags (comma-separated)
Save Edits
Cancel