简单介绍HTML5中的文件导入分享!

index.html
 

XML/HTML Code复制内容到剪贴板

  1. …   
  2.   <link rel="import" href="x-component.html">  
  3. </head>  
  4. <body>  
  5.   <x-component>  
  6.     <h1>This is Custom Element</h1>  
  7.   </x-component>  
  8.   …  

注意,因为x-component.html 中的document 对象跟index.html的一样,你没必要再写一些棘手的代码,它会自动为你注册。
支持的浏览器

本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

ctvol管理联系方式QQ:251552304

本文章地址:https://www.ctvol.com/htm5ctutorials/473492.html

(0)
上一篇 2020年10月26日
下一篇 2020年10月26日

精彩推荐