How to load nav menu from an external file? (No Wamp, all code must be 'browser-side')

前端 未结 5 883
攒了一身酷
攒了一身酷 2020-12-12 07:22

I have a static HTML web site. I want to store the the nav (top) menu in an external file so when I change the menu, I want to see the change in all pages.
I RE

5条回答
  •  感情败类
    2020-12-12 07:53

    nav.html // you dont need to put html, body or etc. Just the nav itself.

    
    

    index.html

    
    
    
      
        onload test
        
      
    
    
      
        

    The load event fires when the document has finished loading!

    TRY this. this might be the answer of your question.

提交回复
热议问题