开发者

how to create a menu in html dynamically

I'm not sure if I am using the proper term when I refer to "dynamically. *

I want to have a simple, one level, menu displayed on all 80 pages of my site. The menu items will change periodically - new items added, some removed, etc... What is the best way to create this menu so I don't have to update all开发者_运维技巧 80 pages? FYI: I'm not too knowledgeable in all the scripting languages. Thank you.**


The simplest way is to use PHP.

Name all your files so they end in php instead of html, and make a file called menu.php.

Copy your menu into menu.php, then no your other pages where you want the menu, type:

<? include("menu.php"); ?>

and the menu will appear like magic!

I would also suggest SSI, but they are often disabled on shared hosting in my experience.


Create a master page if your working in any one of the "major" web frameworks. You put a lonely HTML tag up there so I'm not sure if this NEEDS to be purely HTML and nothing else.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜