掌握HTML页面 [英] Master page in HTML
问题描述
有什么方法可以在纯HTML中创建与ASP.NET中的主/内容页相似的想法?
我想用HTML创建几个页面,但我希望他们都看起来不一样的内容相同。有没有办法做到这一点,而不创建几个彼此非常相似的页面?
<$ c
$(document).ready(function(){
//将menu.html内容添加到任何#menu元素
$( '#menu')。load('menu.html');
});
关于其他一些答案,应谨慎并谨慎地使用iframe。
http://rev.iew.me/help-moving-from- iframes
http://fsvieira.com/2013/06/11/iframes-bad-for-a-website/
重复的问题在这里回答:如何使用HTML创建主页面?
Is there any way to create a similar idea as master/content page in ASP.NET in pure HTML?
I want to create several pages in HTML, but I want that all of them look the same with some contents different. Is there any way to do this without creating several pages which are very similar to each other?
//wait until the dom is loaded
$(document).ready(function () {
//adds menu.html content into any "#menu" element
$('#menu').load('menu.html');
});
In reference to some of the other answers, iframes should be used carefully and sparingly. http://rev.iew.me/help-moving-from-iframes
http://fsvieira.com/2013/06/11/iframes-bad-for-a-website/
Duplicate question here with answer: How to create a master page using HTML?
这篇关于掌握HTML页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!