If all my web pages have the same navigation and footer markup, what is the best way of avoid hard-coding this in every page, so if it needs changing it's only changed in one place so as not to have to edit every html file?
Thanks
If all my web pages have the same navigation and footer markup, what is the best way of avoid hard-coding this in every page, so if it needs changing it's only changed in one place so as not to have to edit every html file?
Thanks
使用 AJAXload()
方法。
$('#mysection').load('yourfile.html');
当然 URL 也可以指向 PHP 脚本等。
几个选项:
您应该使用服务器端解决方案,具体取决于您使用的技术(PHP、ASP 等...)我认为您应该看看这个链接。