Embedding javascript in page

1
Hi, I'm trying to add an external object to my mendix app. In this case I need to display BI info (a chart) that is externally hosted. I'm using the HTMLSnippet ad-on, but I can't get it to work. The code Ì'm placing in the HTMLSnippet is similar to the one below. (I replaced the personal data with 'xxx'). If I select 'HTML' in the HTMLSnippet it does indeed render a blue box, but doesn't display the external info. If I select 'Javascript' in the HTMLSnippet it gives me a syntax error. Does somebody know how I can get the code below to be correctly embedded in my Mendix App? Thanks! <div id="myReportDiv" style="background: blue; width: 500px; height: 350px"> <script src="http://xxx/JsAPI?reportUUID=e5e5aaf3-c3b8-4f9b-8280-e21e4d848e63&elementId=myReportDiv&username=xxx&password=xxx" type="text/javascript"></script> </div> UPDATE: If I have selected 'HTML' in HTMLSnippet, the result is a blue square on the page. Without the content that should be pulled from the external web server. The 'inspect element' in the browser gives me the following info: <div data-mendix-id="1706" class="mx-name-hTMLSnippet1" tabindex="0" id="HTMLSnippet_widget_HTMLSnippet_0" focusindex="0" widgetid="HTMLSnippet_widget_HTMLSnippet_0" style=""><div id="myReportDiv" style="background: blue; width: 500px; height: 350px"> <script src="http://xx.xx.155.89/JsAPI?reportUUID=3cbf9794-9898-4dbf-babb-8d0385479b39&amp;elementId=myReportDiv&amp;username=xxx&amp;password=xxx" type="text/javascript"></script> </div></div> Browser Console: The XMLHttpRequest progress event property 'position' is deprecated. Please use 'loaded' instead. mxui.js:21 Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/. If I select 'javascript' in the HTMLSnippet. I get a javascript syntax error: The 'Inspect Element' in the browser: <div data-mendix-id="1706" class="mx-name-hTMLSnippet1" tabindex="0" id="HTMLSnippet_widget_HTMLSnippet_0" focusindex="0" widgetid="HTMLSnippet_widget_HTMLSnippet_0">Error while evaluating JavaScript: SyntaxError: Unexpected token <</div> Browser Console: The XMLHttpRequest progress event property 'position' is deprecated. Please use 'loaded' instead. mxui.js:21 Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/.
asked
0 answers