HTML Import ignoring <script> tags

52 Views Asked by At

I'm importing an .html file which contains a tag into another .html file. Here's an example:

File foo.html

...
<head>
  <link rel="import" href="bar.html" />
</head>
...

File bar.html

...
  <script src="bar.js"></script>
...

File bar.js

console.log("Hello world");

In the Chrome DevTools "Network" tab, I can see both foo.html and bar.html being fetched, but bar.js is not, so there is no console log. I can't really see why bar.html is ignoring the script tag when it's being imported.

Can anyone give me a hint? Thanks!

0

There are 0 best solutions below