How can I make my navi-bar the same across my html?

后端 未结 9 804
长发绾君心
长发绾君心 2020-12-05 13:26

With each new page I have to update the navigation panel. Which means I go from page to page copying and pasting my navigation bar. The more pages I add the harder it gets.

9条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-05 14:02

    Simply use jQuery .load(). It is very easy to use. Here's an example

    navbar.html

    This is the navigation bar

    index.html

    
    
    
    Home Page
    
    
    
    
    
    
    
    

    This is the homepage.

    about.html

    
    
    
    About Page
    
    
    
    
    
    
    
    

    This is the about page.

提交回复
热议问题