您可以使用jquery完成此 *** 作。
将此代码放在
index.html
<html><head><title></title><script src="https://pre.jquery.com/jquery-3.3.1.js" integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60=" crossorigin="anonymous"></script><script> $(function(){ $("#header").load("header.html"); $("#footer").load("footer.html"); });</script> </head><body><div id="header"></div><!--Remaining section--><div id="footer"></div></body></html>
并将此代码放在
header.html和中
footer.html,与
index.html
<a href="http://www.google.com">click here for google</a>
现在,当您访问时
index.html,您应该可以单击链接标记。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)