介绍
这篇文章主要介绍HTML5中公共页面如何提取作为公用代码,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!
在网站制作中有很多部分的代码是相同的,如页脚部分,可以把这段代码提取出来,在别的页面调用。
索引。html
& lt; !——,底部加载外部文件,——比; ,,,& lt; footer 类=癴ooter"比; ,,,& lt;/footer> ,,,& lt; script> ,,,,,,,美元(& # 39;.footer& # 39;) .load (& # 39; conment/foot.html& # 39;,函数(responseTxt statusTxt, xhr) { ,,,,,,,,,,,console.log (& # 39; responseTxt statusTxt, xhr # 39;) ,,,,,,,,,,,//,console.log (responseTxt) ,,,,,,,,,,,//,console.log (statusTxt) ,,,,,,,,,,,//,console.log (xhr) ,,,,,,,}) ,,,& lt;/script>
。html
& lt; html lang=癳n"比; & lt; head> ,,,& lt; title> Document ,,,& lt; link rel=皊tylesheet" https://www.yisu.com/zixun/, href=" css/foot.css "> 链接> 头 <身体> … 身体>