Click to See Complete Forum and Search --> : Importing HTML code
picto
10-16-2004, 06:56 PM
Hi, is it possible to import a chunk of HTML into your page.
I want to make a menu on the left of the screen, but don't want to use frames. The way I have it at the moment I have to update the menu list on every page. I would like the menu code to be in a separate file which I can just say -use this code-. Is this possible?
Thanks
BonRouge
10-16-2004, 07:37 PM
You could use server side includes (SSI).
Put this in your code :
<!--#include virtual="menu.txt" -->
Save your html to a .txt file (menu.txt) and upload it to the server.
Save your page as .shtml and upload it.
This should work fine if your server supports it.
Try it out and see... If it doesn't, there are other ways... (come back if it doesn't work).
IncaWarrior
10-16-2004, 07:50 PM
or the classic javascript option if you can't use SSI
Paul Jr
10-16-2004, 09:58 PM
Not JavaScript! That's not a good idea at all! 1 in 10 people don't have JS enabled!
IncaWarrior
10-17-2004, 12:53 PM
Well I guess they'll miss out on those parts of the website. Their fault for turning off javascript.
Ben Rogers
10-17-2004, 06:00 PM
Originally posted by IncaWarrior
Well I guess they'll miss out on those parts of the website. Their fault for turning off javascript. Or maybe they just wanted to get rid of all the crap that people tend to do with JS? Fact is, JS should be left to handle dynamic effects, and only that.
Charles
10-17-2004, 06:02 PM
Originally posted by IncaWarrior
Well I guess they'll miss out on those parts of the website. Their fault for turning off javascript. And those who do not use JavaScript because of some disability? Do you mean to suggest that the disability is their own fault?
And wouldn't that be like making an MSIE dependant site (and more people use MSIE than use JavaScript) believing that those who cannot access your site get what they deserve?
Ben Rogers
10-17-2004, 06:46 PM
Originally posted by Charles
And those who do not use JavaScript because of some disability? Do you mean to suggest that the disability is their own fault?
And wouldn't that be like making an MSIE dependant site (and more people use MSIE than use JavaScript) believing that those who cannot access your site get what they deserve? Good point. You should never just say "Well, you aren't the same as me, so screw you!"
PeOfEo
10-17-2004, 07:58 PM
Originally posted by Ben R.
Good point. You should never just say "Well, you aren't the same as me, so screw you!" Only when you are talking about politics :p. I was about to say what charles said until I saw his post :x
picto
10-18-2004, 12:26 PM
The SSI stuff worked, thanks a lot. Am I correct in thinking this works independently of the browser used?
Ben Rogers
10-18-2004, 03:31 PM
Originally posted by picto
The SSI stuff worked, thanks a lot. Am I correct in thinking this works independently of the browser used? Yes. The server peices together the code, and sends that to the browser. (No, that's not a technical explanation, but it is pretty much what it does, so...)
PeOfEo
10-18-2004, 09:38 PM
If you view your source of the page using the include you wills ee that the html from the page is just poped right in there, there is no evidence that the code was not there to begin with, other then the .shtml extention (or any other server side extention you might be using).