Where should the javaScript (I would like to use jQuery) that I would like to reference throughout the project be kept?

1
Hi there, Where should I put the javaScript (I want to use jQuery) that I want to reference throughout the project? From that process, I also want to call MicroFlow, so I am looking for an easy way to see it in text. Would it be best to add a script tag to index.html and write the path to be referenced there? In that case, the referenced path would be under resources? Or is there a default path you would recommend?   Thanks a lot in advance!
asked
2 answers
2

Hi Toshiya

Copy index-example.html file from deployment\web folder within the app dire.
and
Paste it into theme\web folder
Rename it into an index.html file, and open the index.html file add anything you want.
Example: add <script src="alert.js"></script> and in theme\web folder create a file alert.js and in alert.js file create write alert(); and start your app.
It should work. 

answered
2

Are you using the HTML Snippet widget to insert your JavaScript? If you are, that widget can bring in the jQuery library automatically if you use the “JavaScript with jQuery” content type. 

https://docs.mendix.com/appstore/widgets/html-javascript-snippet/

It may save you from having to add jQuery manually.

answered