html - Google Chrome 仍然支持 HTML 导入吗?

标签 html google-chrome web-component html-imports

根据 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 .

对于其他浏览器,您可以使用:

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/

相关文章:

html - 根据第一项宽度设置第二项边距

css - 如何在 headless chrome 生成的 pdf 中隐藏边距?

javascript - 正在申请:focus CSS to input-field in shadowDOM and :focus CSS to shadow host

javascript - Vuejs : Can't pass object to web component using v-bind

html - 使用css在div之后隐藏文本

javascript - 如何在 Canvas 中旋转图像

javascript - 为什么要避免在网页中直接定义 JavaScript 函数?

javascript - 我的 JQuery 在 Chrome 上无法运行,有时在 Firefox 上可以运行,然后停止

jquery - 使用 jQuery 在 Chrome 扩展弹出窗口中显示隐藏 div

javascript - polymer 核心列表在 Chrome 中不起作用