Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. include html in html

include html in html

Scheduled Pinned Locked Moved Web Development
htmlquestion
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Brakanjan
    wrote on last edited by
    #1

    Hi I have a menu (html) that always stays the same. I want to include this menu on my other html pages, but don't want to use frames. How is this done? I know there's a #include syntax in asp, but I want to use only html. tx

    R V 2 Replies Last reply
    0
    • B Brakanjan

      Hi I have a menu (html) that always stays the same. I want to include this menu on my other html pages, but don't want to use frames. How is this done? I know there's a #include syntax in asp, but I want to use only html. tx

      R Offline
      R Offline
      Robby
      wrote on last edited by
      #2

      (i.e. if I have an includes folder at the root of my web dir) or (i.e. to 'step back' one dir and into the includes folder.) include virtual is the best way to include a file.

      B 1 Reply Last reply
      0
      • R Robby

        (i.e. if I have an includes folder at the root of my web dir) or (i.e. to 'step back' one dir and into the includes folder.) include virtual is the best way to include a file.

        B Offline
        B Offline
        Brakanjan
        wrote on last edited by
        #3

        Hi sorry but this stil does not work, I don't know what I'm doing wrong! my one file is a.html: standard "hallo world" sentence the other one is b.html: in the same dir...

        R Z 2 Replies Last reply
        0
        • B Brakanjan

          Hi sorry but this stil does not work, I don't know what I'm doing wrong! my one file is a.html: standard "hallo world" sentence the other one is b.html: in the same dir...

          R Offline
          R Offline
          Robby
          wrote on last edited by
          #4

          If using 'include virtual' it doesn't matter if the file is in the same directory or not - you always specify the absolute path from the web root. Meaning, if your domain name is acme.com, and you have a folder called 'includes', then the full URL to your includes would be www.acme.com/includes/...same with this. If your a.html is in a directory other than the web root, then you have to specify it (i.e., include virtual = "/includes/a.html" or whatever your path is). If it's in the same directory you can simply use 'include file' and it will work in your particular example as well. Robby

          1 Reply Last reply
          0
          • B Brakanjan

            Hi sorry but this stil does not work, I don't know what I'm doing wrong! my one file is a.html: standard "hallo world" sentence the other one is b.html: in the same dir...

            Z Offline
            Z Offline
            ZoogieZork
            wrote on last edited by
            #5

            This is SSI (server-side include) syntax and must be supported by the web server. Either the web server must be configured to treat .html files as SSI files or the file must be renamed to the use the extension associated with SSI (usually .shtml). Think of SSI as a "lightweight" scripting language that doesn't have the advanced features of languages like ASP/JSP/PHP. - Mike

            1 Reply Last reply
            0
            • B Brakanjan

              Hi I have a menu (html) that always stays the same. I want to include this menu on my other html pages, but don't want to use frames. How is this done? I know there's a #include syntax in asp, but I want to use only html. tx

              V Offline
              V Offline
              Vasudevan Deepak Kumar
              wrote on last edited by
              #6

              Hi Brakanjan: You can have the menu as a .JS file with the statements like document.write (''); Assuming your .Js file is named as menu.js Now in other pages you can just include this in your other pages as: Did this solve your problem? Deepak Kumar Vasudevan Personal Web: http://www24.brinkster.com/lavanyadeepak/default.asp I Blog At: http://deepak.blogdrive.com/

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups