I have two javascript libraries, one in which I wrote as a connector and the other being a thirdparty library "bootbox.js". I'm using requirejs to setup my custom library, however I'm not sure how to do the same for bootbox.js without having to alter the bootbox js code.
the js error I'm getting.
TypeError: $ is not a function
Current config.
warnings.js
requirejs.config({
"shim": {
'bootbox': {
deps: ['./jquery']
}
}
});
define(["./jquery", "./vendor/bootbox"], function($) {
var int;
int = function(spec) {
$('#' + spec.id).dialog({do something});
}
return int;
}
and now bootbox.js
window.bootbox = window.bootbox || (function init($, undefined) {
"use strict";
//do something
}(window.jQuery));
Anybody know how to get the bootbox js library to use the jquery namespace?