如何在GitHub的电子框架中包含部分html? [英] How can I include partial html in github's electron framework?

查看:44
本文介绍了如何在GitHub的电子框架中包含部分html?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在github的电子产品中,是否存在内置的机制来包含部分html文件?

In github's electron, is there a built-in mechanism for including partial html files?

例如,如果我在html中设计布局

for example, if I design a layout in html

<body>
    <div>
        <ul><li>Menu Item 1</li><li>Menu Item 2</li></ul>
    </div>
    <div id="dynamic-content">
        <!-- I would like this content to be loaded from partial html files -->
    </div>
</body>

我如何将ID为 dynamic-content的不同文件中的内容放入div? p>

How would I put content from different files into the div with id "dynamic-content"?

推荐答案

有很多方法可以做到这一点。根本没有提供有关何时加载动态内容的任何信息。我想这是点击链接。

There are many ways to do that. At all you didn't give any information about when you want to load the dynamic content. I guess that it is a click on a link.

解决方案没有什么不同,当您使用普通网页进行操作时。

The solution is not different, when you would do that with a normal webpage.

只要给您提示:

  • Loading an HTML file into a DIV with a link
  • How do I load an HTML page in a <div> using JavaScript?
  • You can also solve it with jQuery http://api.jquery.com/load/
  • Or angular also gives you a possibility to do that.

这篇关于如何在GitHub的电子框架中包含部分html?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆