| |
|
Welcome to KnowledgeSutra - Dear Guest | |
Integrating One Html File Into Another
#32
Posted 20 September 2009 - 01:29 AM
Okay, I accept a few things already. One, this may be insanely hard to impossible. Two: It is complicated to explain.I'm trying my best to keep several sites up to date, with several things ranging from schedule, to practice times, etc. The 'Master site' where I place a large chunk of (sometimes all of it) data, is one step. But then I have to take the appropriate bits and move them to their respective sites as well.I'm trying to find out of there is a way to extract/snip/look at a specific section of my master site, using code located on the secondary site(s), so I only have to update one of them, and the others fall in place as well.This would cut about 30 minutes to an hour off my average time updating stuff.
-reply by David#33
Posted 02 January 2010 - 08:54 AM
Hi Jerry,
Sorry this reply is after Christmas,
1. I guess you could try and incorporate an <iframe> into the page to display the menu on the left which would load your menu contained in a seperate html file?
2. Or the other option would be to use javascript, (document.Write) to write the html code for the menu and put that in an external .Js file that each of your actual pages would load. So if you had two <div>'s the script tag with the .Js location would go in the left <div>.
ie.
HTML:
<link rel="stylesheet" type="text/css" media="all" href="location/menu.Css"/> </head><div id="menu"><script type="text/javascript" src="location/menu.Js"></script></div><div id="mainContent">All of your actual content for the page</div>
CSS:
menu {Float: left;Width: x px;Etc...}MainContent {Float: right;Width: x px;Etc...}
JS:
document.Write(" HTML CODE FOR ACTUAL CONTENT OF PAGE LINE 1 ");document.Write(" HTML CODE FOR ACTUAL CONTENT OF PAGE LINE 2 ");document.Write(" HTML CODE FOR ACTUAL CONTENT OF PAGE LINE 3 ");document.Write(" HTML CODE FOR ACTUAL CONTENT OF PAGE LINE 4 ");Etc...
With both options you would probably style the menu using CSS contained in a seperate .Css file.
A problem you might find with both of these options is the extra security implemented when loading webpages stored on your local hard disk or CD that may restrict Javascript or iframe usage for the user? Although as you've created CDs before I'm sure you come across these problems before!
Hope this helps..
Mark
-reply by Mark
Reply to this topic

1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users














