I need to call below script in header of pages.
I know the approach to call normal javascripts.
But the problem is with property “asynch”.
This is mandatory and should be “asynch” only. If we do not set this property the script will fail. Script should be added in Header section of HTML and should be aynch otherwise it will fail.
Could you please suggest as how can we do this specifically.
<script src=https://XXXXX.com/somejavascript-development.min.js async></script>
Hi Antu,
I think this topic can help https://www.outsystems.com/forums/discussion/64758/adding-script-tag-to-reactive-web-app/
Regards,
Khuong
Hi Khuong
Thanks for the information provided by you.
However I am looking for the option to add property "asynch" in javascript.
In addition to the previous solution, You can also try the below mentioned JS approach..
- Using a JS node (for reactive) in the OnInitialize handler execute the below script
JavaScript Snippet:
(function() { var scriptEle = document.createElement('script'); scriptEle.type = 'text/javascript'; scriptEle.async = true; scriptEle.src = '<src>'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(scriptEle, s); })();
I hope this helps you!
Kind regards,
Benjith Sam
Hi @Antu Singh
approach 1 : Interface -> Scripts ->Create Script -----------just copy and paste the whole content of that min.js , if that throws error
approach 2 :use requirescript
oninitialize just use that require script and pass https://XXXXX.com/somejavascript-development.min.js in URL
Hope it will work
Hi,
I think that this doc can help you: https://success.outsystems.com/Documentation/11/Extensibility_and_Integration/JavaScript/Extend_Your_Mobile_and_Reactive_Apps_Using_JavaScript/Defining_Asynchronous_JavaScript_Code
Hope this can help.
Best regards,
Ricardo Pereira