javascript - Same sidebar across webpages -


i'm pretty new web development. best practice in keeping same sidebar , other elements across web pages on one's site? store sidebar html , call that? if so, how 1 go doing that?

here's one way it: use "include" files. no javascript required. server work, instead of requiring client add content.

ssi, or server side includes, first developed allow web developers "include" html documents inside other pages. if web server supports ssi, it's easy create templates web site.

save html common elements of site separate files. example, navigation section might saved navigation.html or navigation.ssi. use following ssi tag include html in each page.

<!--#include virtual="path file/include-file.html" --> 

use same code on every page want include file.

that page describes other approaches. if know called using include files, can search more easily. example, this article describes includes , how call them javascript if must.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -