Hello,
I want to add CDN on-page Like:-
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB41DRUbKWJHPxaFjMAwdrzWzbVKartNGg&callback=initMap&v=weekly" defer></script >
Where the key of that particular API is dynamic for users is there any way to add this google matrix API CDN on the page
I already used this on-page ready and initialize but did not load the full CDN script:-
var scriptNode = document.createElement('script'); scriptNode.src = "";
scriptNode.async= "async";
scriptNode.defer = "defer" ;
document.getElementsByTagName('head')[0].appendChild(scriptNode);
Hi Gourav,
Refer to this post: /forums/how-to-load-JavaScript-file-in-reactive-application
I hope this helps you!
Kind regards,
Benjith Sam
This post suggests adding a whole js script in the service studio this is not the right way to use any CDN, it also makes a web page slow and we can't get the latest code changes on that script.
Did you find a solution? I have the exact same issue and I don't want to add the whole script to my application for obvious reasons.
Regards,
Roxane
Searching for the same functionality reference the cdn and not downloading the js and adding it as a script file. Did you ever get an answer?