How to include one HTML file into another?

后端 未结 4 900
栀梦
栀梦 2020-12-10 16:59

I have tried every possible question here on stackoverflow but unable to resolve this issue ...

    
    

        
4条回答
  •  [愿得一人]
    2020-12-10 17:26

    HTML doesn't have an 'include' mechanism - I'm not sure where you've seen these solutions on StackOverflow. You've probably been looking at answers for a server side language such as PHP or ASP.

    You do have the following options for 'pure' HTML where you only have static pages and JavaScript:

    1. Frames
    2. Ajax

    See my answer here for sample code and more details (and also a caveat about SEO if that matters to you).

提交回复
热议问题