Click to See Complete Forum and Search --> : Inserting Menu


Prince
11-25-2001, 12:02 AM
I want to insert a DHTML menu in my web page (lets say 1.html).
But I want to put DHTML menu code in (menu.html) and I want 1.html to pull it from menu.html when ever 1.html is loaded.

Does anyone know can this be done in DHTML/Javascript? or with any other script?

compatiblity with browser (mainly Netscape 4+ and IE4+ is must)

thanx

bIOHZRd
11-25-2001, 01:52 AM
In your header of whatever file you need to include in...

<script src="sourcefile.js"></script>

That will include everything from sourcefile.js in the current page.

-edit-
Of course, that is for including Javascript into your page, which is basically DHMTL stuff...

------------------
<A HREF="http://home.columbus.rr.com/bio/benchmarks.htm" TARGET=_blank>-=T'bird 1000=- | -=768 Crucial PC133=- | -=GeForce2 MX 32mb eVGA=-
-=Abit KT7a-Raid=- | -=40gb ata/100 WD=- | -=Sound Blaster Live!=-</A>

[This message has been edited by bIOHZRd (edited November 25, 2001).]

Prince
11-25-2001, 06:28 PM
Originally posted by bIOHZRd:
In your header of whatever file you need to include in...

&lt;script src="sourcefile.js"&gt;&lt;/script&gt;

That will include everything from sourcefile.js in the current page.

-edit-
Of course, that is for including Javascript into your page, which is basically DHMTL stuff...



JS is different from DHTML. I found a way for my menu to work as I want. Wouldn't apply to anyone else.
But basically nothing to do that, unless Server Based dynamic webpages are used

kid A
11-27-2001, 04:41 AM
Have you considered using server side includes (ssi), or PHP include function? Those would easily do it for you I think.

------------------
Now listening to:
U-star Recordings - More or Less

Prince
11-28-2001, 06:21 AM
Originally posted by kid A:
Have you considered using server side includes (ssi), or PHP include function? Those would easily do it for you I think.



Just curious. Which webservers support SSI. (I am guessing, running a saved SSI coded webpage on HD will not use SSI)

Grizzly
11-28-2001, 07:07 AM
Nearly all leading Web Servers today support SSI commands. Apache & IIS being the most prominent.

And you're right, double clicking on a web document on your harddrive will NOT parse the SSI commands, you need to view the page through a web server in order to have the SSI commands parsed. It's best to setup a simple web server on your local machine for that kind of testing.