Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 73905

Import external html containing script tag - doesn't work

$
0
0

I have an index.html

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>MyApp</title>
  <link rel="import" href="./common.html">
</head>
<body>
  <app-root></app-root>
</body>
</html>

and an external HTML file common.html which contains a script tag

<script>
  window.MY_APP = {
    MY_SETTINGS: {}
  }
</script>

As you can see I am importing common.html in index.html. The problem is that MY_APP becoming undefined after a successful render of index.html. I could see success call to common.html file in the network tab(Testing in Chrome browser - V 80.**).

This used to work seamlessly earlier but now broken.

Did anyone face this problem? or does anyone know what is happening? Thanks in Advance.


Viewing all articles
Browse latest Browse all 73905

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>