有没有什么方法可以在纯 HTML 中创建与 ASP.NET 中的母版/内容页类似的想法?
我想用 HTML 创建几个页面,但我希望它们看起来都一样,只是有些内容不同。有没有办法在不创建几个彼此非常相似的页面的情况下做到这一点?
最佳答案
//wait until the dom is loaded
$(document).ready(function () {
//adds menu.html content into any "#menu" element
$('#menu').load('menu.html');
});
引用其他一些答案,应谨慎而谨慎地使用 iframe。 http://rev.iew.me/help-moving-from-iframes
http://fsvieira.com/2013/06/11/iframes-bad-for-a-website/
此处重复问题及答案:How to create a master page using HTML?
关于html - HTML 格式的母版页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5332751/