Using bootstrap.js from the deployment folder in a widget

Hi all,   I've just created a widget that makes use of a function in the bootstrap.js. Every Mendix project contains this file by default \deployment\web\lib\bootstrap\js but appearently I can't use functions in my widget. How can I access this file from my widget without adding the bootstrap.js and jQuery.js (since bootstrap.js requires it) to my widget.    Thanks in advance! Jeroen
1 answers

Hi Jeroen,

The best practice is to bundle your libs with your widget (it needs to a AMD module).

place your lib inside /<WidgetName>/lib

require it in your widget

define([ /* widget module */ "/<WidgetName>/lib/yourModule"], function(/* widget module*/ yourModule){

    // do your module stuff



I would discourage to use JQUERY at all! It does not play well with others and will bite you in your back. 

Cheers, Andries