Link to Externally hosted javascript

0
Hey guys, I have been given an externally hosted script to place onto our Mendix site for accessibility with a company called BrowseAloud. It takes the form of a <script> tag as follows: ​​​​​​​<script type="text/javascript" src="https://www.browsealoud.com/plus/scripts/3.1.0/ba.js" crossorigin="anonymous" integrity="sha256-editedforbrevity sha512-editedforbrevity=="></script> I tried adding this to the HTMLsnippet widget in the Atlas_TopBar layout, but the script simply doesn’t fire. I even tested it with a simple <script>alert(‘hello world’)</script> on the page, and even though the markup is inserted into the page, it doesn’t actually fire the script. Can someone give me some next steps for how to run this?
asked
2 answers
0

Hey Russel,

You can place this  script in your index.html file which can be found in your folder directory

My Documents > 'Your project’ > theme > index.html

Place your script right before the end of the body tag

answered
0

Hi,

 

I have such a case, wondering why the Javascript Snippet does not work for you, but as alternative solution, you can use the timer widget to trigger a nanoflow after some milliseconds. that would be a more stable option to make sure your script is being triggered.

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

 

Regards,

 

answered