Inserting Menu

Sharky Forums


Results 1 to 6 of 6

Thread: Inserting Menu

  1. #1
    Tiger Shark
    Join Date
    Nov 2000
    Location
    Canada
    Posts
    811

    Post Inserting Menu

    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

  2. #2
    Reef Shark
    Join Date
    Feb 2001
    Location
    Minot, ND
    Posts
    387

    Post

    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).]
    My Site -=[http://hzrd.us]=-
    Puter #1
    Athlon XP 2600+ @ 2.2GHz 11.5x190 | 2x512mb Corsair c2 3200 | Radeon 9800 Pro |Asus a7nx8 | WD 120GB/ Seagate SATA 120GB x 2


    Puter #2
    T'bird 1000@1224 | 768 Crucial PC133 | GeForce2 MX 32mb eVGA | Abit KT7a-Raid | 40gb ata/100 WD | Sound Blaster Live!

  3. #3
    Tiger Shark
    Join Date
    Nov 2000
    Location
    Canada
    Posts
    811

    Post

    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

  4. #4
    Ex-*** kid A's Avatar
    Join Date
    Sep 2000
    Location
    Norway
    Posts
    5,322

    Post

    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
    Now listening to various rock and metal
    143rd member to join Sharkyforums.

  5. #5
    Tiger Shark
    Join Date
    Nov 2000
    Location
    Canada
    Posts
    811

    Post

    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)

  6. #6
    Ursus Arctos Moderatis Grizzly's Avatar
    Join Date
    Sep 2000
    Location
    Providence, RI USA
    Posts
    3,077

    Post

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •