Using jquery with requirejs -


i have 2 javascript libraries, 1 in wrote connector , other being thirdparty library "bootbox.js". i'm using requirejs setup custom library, i'm not sure how same bootbox.js without having alter bootbox js code.

the js error i'm getting.

typeerror: $ not 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 bootbox.js

window.bootbox = window.bootbox || (function init($, undefined) {   "use strict";     //do }(window.jquery)); 

anybody know how bootbox js library use jquery namespace?

in app.js file

require.config({     ....     shim: {         'bootbox': {             deps: ['./jquery'] --> dependancies          }     } )} 

this means when

require('bootbox')  

then require.js bring jquery first , load other file . please visit this link more info


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

c++ - Correct method for redrawing a layered window -

java.util.scanner - How to read and add only numbers to array from a text file -