Java Script Usage

3
General question: I have a Java Script that I'd like to leverage in my application. Is this possible? Are there any "special" set-up or usage requirements?
asked
5 answers
4

This is perfectly possible.

If your JS code is not inside a custom widget you just have to include it in the header of the theme file.

If you require post-document-load you can add functions to mx.addOnLoad(). (If you overwrite window.onload the results are unpredictable).

As long as you don't override the Global variables 'mx', 'mendix' and 'dojo' you should be fine.

answered
3

Or you can directly insert a javascript block into a specific form by using this widget: HTML/ JavaScript widget

answered
1

Or (to add to the list here) create a widget for it and load it into your project. This lets you customize it in the Modeler instead of having to mess around in our theme/web map, but will require some more effort to create.

For more information: Custom Widget Tutorials.

answered
0

You could insert your javascript code in the index of your theme.

answered
-3

You could insert your javascript code in the index of your theme.

answered