【问题标题】:How do I Run a Template.HTML file in Index.html?如何在 Index.html 中运行 Template.HTML 文件?
【发布时间】:2021-10-29 03:59:53
【问题描述】:

我下载了这个模板:https://github.com/cobidev/simplefolio 来创建一个个人网站,并在 src 文件夹中编辑了 template.html 文件。如何在 index.html 中运行 template.html 文件,以便部署 index.html 文件?将代码复制到新的 index.html 文件中只会产生没有任何动画的纯 HTML。

【问题讨论】:

  • 您在测试期间使用什么来托管所有这些?如果您正在访问以file: 而不是http(s): 开头的内容,那么出于安全原因,这些Javascript 链接都不会运行。
  • 现在,我将它托管在 localhost:8080 上,运行良好

标签: html npm


【解决方案1】:

您可以使用 iframe 呈现页面。但您也可以检查 index.html 中的资产路径,然后无需使用 iframe

<iframe src="template.html" width="100%" height="100%"></iframe>

【讨论】:

    猜你喜欢
    • 2014-04-02
    • 2013-11-14
    • 1970-01-01
    • 2021-02-05
    • 2020-06-24
    • 2017-07-14
    • 2016-11-23
    • 2019-04-20
    • 2022-11-03
    相关资源
    最近更新 更多