I'm trying to load a plugin using requirejs, but sometimes I get an error, "$ .fn is undefined", but if I disappear when loading the page again, as if the sequence has been cached, the problem has been removed. I am loading my libraries like this:
is needed (["jquery-1.4", "/script/jquery.auto.suggest.packed.js"], function ( $) {$ (Function () {// code});}); Can you see that there is something wrong with this implementation which will cause this error? JS is required on the page such as:
& lt; Script type = "text / javascript" src = "http://website.co.uk/frameworks/requirejs/0.2.4/commendedmodules/ require.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" & gt; Expected map = {"jquery-1.4": "http://website.co.uk/sharedmodules/jquery-1.4"}; Requirement ({baseUrl: 'http://website.co.uk/', Path: requireMap}); & Lt; / Script & gt; It can not be converted because I use this setting.
Any suggestions?
Thank you!
The order plugin has been removed. The use of shim loading is as follows:
requirejs.config ({path: {'jquery': 'https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery min', 'bootstrap': '../bootstrap/ Js / bootstrap.min ',' select2 ':' vendor / select2 ',' jshashtable ':' vendor / jshashtable-2.1 ',' jquery.numberformatter ':' vendor /jquery.numberformatter-1.2.3.min ',' Jq-datepicker ':' vendor / bootstrap-datepicker ',' jq-datepicker.da ':' vendor / bootstrap-datepicker.da '}, // plug-in for use shimm that does not support AMD Shim: {'Bootstrap '[Jquery'], 'select2': ['jquery'], 'jq-datepicker': ['jquery'], 'jshashtable': ['jquery'], 'jquery.numberformatter': ['jquery ',' Jshashtable ']},}); Reference:
Comments
Post a Comment