How to include an HTML file with jQuery?

后端 未结 3 1383
南笙
南笙 2020-12-14 03:03

I want to make my code separate so I decided to divide each div to html files. Each HTML file has some jQuery click events. I have 2 files index.html

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-14 03:40

    In your HTML:

    
    
    This is the main content, from the index file

    In a separate file "_HeaderPartial.html":

    This is the Header from its _Partial file

    In a separate file "_FooterPartial.html":

    And this is from the footer partial file
    

    The result:

    This is the Header from its _Partial file

    This is the main content, from the index file

    And this is from the footer partial file

提交回复
热议问题