Is it possible to debug JavaScript when using DukeScript? I've tried adding FirebugLite
<script type='text/javascript' src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script>
It loads and that's awesome but it has no visibility of the $root model. Also I don't know if it's possible to add breakpoints.
Partly, one can include FirebugLite. See for example here. One problem I've found is that Firebug loads but has no visibility of the model, $root returns undefined. I've tried to work around this problem by creating a Javascript resource MyResource.js under main/resouces
Then we create a correpsponding Java class in order to load the resource
Now in the onPageLoad() Java method we can invoke the JavaScript method that loads FirebugLite
Now when Firebug starts, it has at least a scope of its enclosing resource. We still can't add breakpoints because the resource doesn't appear under the files. Perhaps DukeScript experts can suggest a better way of handling this.
Note 1: you can use load Bootstrap simply by including it into the the page with the script tag. See here
Note 2: Unfortunately FireBug Lite seems to have some problems with Bootstrap, beyond version 1.2. See here
Note 3: Here are a couple of ways on how to access a DukeScript model from the javascript context