如何在 github 的电子框架中包含部分 html? [英] How can I include partial html in github's electron framework?
本文介绍了如何在 github 的电子框架中包含部分 html?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在github的electron中,有没有内置的包含部分html文件的机制?
例如,如果我在 html 中设计布局
<ul><li>菜单项 1</li><li>菜单项 2</li></ul></div><div id="动态内容"><!-- 我希望从部分 html 文件中加载此内容 --></div></身体>如何将来自不同文件的内容放入 id 为动态内容"的 div 中?
解决方案 有很多方法可以做到这一点.您根本没有提供有关何时加载动态内容的任何信息.我猜这是对链接的点击.
解决方案与普通网页没有什么不同.
只是给你一个提示:
- 将 HTML 文件加载到带有链接
- 如何加载 中的 HTML 页面使用 JavaScript?
- 你也可以用jQuery解决它http://api.jquery.com/load/
- 或 angular 也可以让您这样做.
In github's electron, is there a built-in mechanism for including partial html files?
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>
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.
Just to give you a hint:
- 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屋!
查看全文