How to add javascript in mendix (not javascript action)

0
Hi, Our organisation uses Piwik as tool to analyze user stats for websites. Because Mendix apps are one-page webapplications we are having trouble add the javascript code provided bij Piwik. Does anyone have experience with the combination of Mendix/Piwik? Or can anyone suggest a good practice to add the javascript to the different pages in our application. We tried to add the javascript to the index.html, but everytime we rerun the application the index.html is overwritten, so we have to link to the javascript in another way. Kind regards, Annelot and Giel  
asked
4 answers
1

If you need to change index.html, you need to copy index-example.html from the deployment/web folder to the theme/web folder, and rename it index.html.

https://docs.mendix.com/howto/front-end/customize-styling-new#9-customizing-index-html-web

To add JavaScript to individual pages, you’ll want to look at the HTML Snippet and JavaScript Snippet modules in the Marketplace.

https://marketplace.mendix.com/link/component/56
https://marketplace.mendix.com/link/component/43096

Hope this helps.

answered
0

You can use this widget for adding custom JS

https://marketplace.mendix.com/link/component/56

answered
0

Thanks Shreyash and Robert, we will look into that!

answered
0

We can make use of Javascript snippet from Mendix app store to add javascript to the pages. In that, we can also add Jquery.

answered