I am new to RequireJS, and for some reason I cannot load scripts through a CDN.
My code:
// site full url
var siteUrl = window.location.protocol+"//"+window.location.host + "/fresh/";
// requirejs config
requirejs.config({
baseUrl: siteUrl + "assets/js/",
paths: {
"plugins": "plugins",
"scripts": "scripts",
"jquery": "https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min",
"jquery-ui": "https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min",
"bootstrap": "https://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/js/bootstrap.min",
}
});
require(['jquery', 'jquery-ui', 'bootstrap', 'plugins/chosen'], function($, chosen){
/*
loading global selectors and variables
*/
//chosen for select boxes
$(".chzn-select").chosen();
});
and jquery fails to load. I get the following errors:
ReferenceError: jQuery is not defined
[Megszakítás ennél a hibánál]
...h"):this.container.removeClass("chzn-container-single-nosearch")),e="",s=this.re...
chosen.js (1. sor)
ReferenceError: jQuery is not defined
TypeError: $(...).chosen is not a function
$(".chzn-select").chosen();
Could please someone point out what I am doing wrong?
P.S: I am defining the site URL because I am using Laravel, without that definition it includes the URL segments in the base URL.