Include html in another html file

后端 未结 6 1312
无人及你
无人及你 2020-12-02 21:14

I have a html \"head\" template and a navigation template that I want to include in all my other html files for my site. I found this post:

Include another HTML fi

6条回答
  •  星月不相逢
    2020-12-02 21:47

    Method 1:

    I think it would be best way to include an html content/file into another html file using jQuery.

    You can simply include the jQuery.js and load the HTML file using $("#DivContent").load("yourFile.html");

    For example

     
       
         
         
       
    
       
         

    Method 2:

    There are no such tags available to include the file but there are some third party methods available like this:

    
    
    
    
    
    
    

    Method 3:

    Some people also used server-side-includes (SSI):

     
    

提交回复
热议问题