根据 http://blog.teamtreehouse.com/introduction-html-imports
To enable HTML imports in Chrome, go to chrome://flags and enable the Enable HTML Imports flag. Once you’re done, click the Relaunch Now button at the bottom of the screen to restart Chrome with support for HTML imports.
但我在最新版本的谷歌浏览器中找不到它
最佳答案
HTML 导入在 Chrome, Opera and Android 中本地实现.
还是一个W3C Working Draft .
对于其他浏览器,您可以使用:
- webcomponentsjs填充,
- 或直接来自HTML Imports 的文件
html-imports.min.js
.
2019 年更新
HTML 导入 won't be supported natively在 Chrome 73 之后。您应该使用其他解决方案:
- polyfill,
- 备用模块加载器,
- JS
import
结合template literals , - 使用
fetch()
直接下载。
2020 年更新
HTML 导入已明确删除。
关于html - Google Chrome 仍然支持 HTML 导入吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34408880/