【发布时间】:2012-03-12 12:00:26
【问题描述】:
我正在尝试制作一个具有动态下拉菜单的 HTML 页面(比如说 index.html)。我想要做的是将我的下拉菜单保存在单独的 html 文件(menu.html)中,以便更容易维护。我想知道的是如何在 index.html 文件中加载 menu.html 文件?
我尝试了一些框架示例,但包含 DD 菜单的 menu.html 文件没有出现在索引页面中。
例如,我在我的索引页面中尝试过这个,但没有出现:
<frameset rows="200,*" frameborder="0" border="0" framespacing="0">
<frame src="menu.html" marginheight="0" marginwidth="0" scrolling="auto" noresize>
【问题讨论】:
-
改用
<iframe src="menu.html"></iframe>。 -
如果你使用iframe标签,别忘了加上宽度和高度。
-
最好使用动态语言,例如 php。我建议这个教程tutorialzine.com/2011/08/jquery-mobile-mvc-website-part-2
标签: html