You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Oh I see the problem. It seems that the js lib some how will execute the code right after injected by above code. But when they are embedded using <script> tag in index.html, they won't execute.
As your guide, I tried to inject css and js libs into page using below code.
`var styleSheet = document.createElement('link');
styleSheet.href = 'https://js.api.here.com/v3/3.0/mapsjs-ui.css?dp-version=1549984893';
styleSheet.type = 'text/css';
document.getElementsByTagName('head')[0].appendChild(styleSheet);
const javaScriptLibs = [
"https://js.api.here.com/v3/3.0/mapsjs-mapevents.js",
"https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js",
"https://js.api.here.com/v3/3.0/mapsjs-core.js",
"https://js.api.here.com/v3/3.0/mapsjs-service.js",
"https://js.api.here.com/v3/3.0/mapsjs-ui.js",
];
javaScriptLibs.forEach(x => {
var script = document.createElement('script');
script.src = x;
script.type = 'text/javascript';
document.getElementsByTagName('head')[0].appendChild(script);
});`
Right after these js libs are injected, I got the errors as below:
Can you help me please?
mapsjs-mapevents.js:1 Uncaught ReferenceError: H is not defined at mapsjs-mapevents.js:1
(anonymous) @ mapsjs-mapevents.js:1
mapsjs-ui.js:1 Uncaught ReferenceError: H is not defined at mapsjs-ui.js:1
(anonymous) @ mapsjs-ui.js:1
The text was updated successfully, but these errors were encountered: