Jump to content
Insert Html Into Html
4 replies to this topic
Posted 15 June 2010 - 07:19 AM
I am developing a great website I am coding completely from my work with the Head First Labs HTML (with CSS & XHTML) books. I have done good work this book but think I'm suddenly out of my depth. There's an index page and 8 subpages on the site and I'm using two CSS stylesheets.
In one section of each of these pages, there is text I want to regularly update WITHOUT having to cut and paste it into each of the 9 pages. Basically, I have some text that's going to change regularly and I want the changes to show up in 9 pages.
I've not found an html tag way to do this and want to make it work so changing that one bit of updated text does not require updating (and pasting code into) 9 pages.
Depending on how I pasted it, I would style it so it keeps the CSS styling so it shows up the same on each page. Is this possible with HTML? Someone please advise...
Any help would be greatly appreciated!
Posted 24 July 2010 - 12:34 PM
var cText = '';
cText += ' <p id=\"heading\">';
cText += ' <img alt=\"Kingdom First Ministries International Image\" src=\"images/banner_small.png\" />';
cText += ' </p>';
In this case if the banner filename changes I just had to update the .js file with the new name and the rest of pages would display the change accordingly.
Be sure to ...
1) escape characters as needed in the .js file so the html is composed properly
2) place the script tags in the html file in the location where you want to see text unless of course if your using css for page layout.
Edited by ajspeller, 24 July 2010 - 12:55 PM.
Posted 24 August 2010 - 02:30 PM
Hi BungeeKY! There is another option
<object classid="clsid:123" data="insertion.html">
Actually, by using JS or php you'll get even more options. Good luck!
When you can't find an answer... http://dld.bz/tdrW
Why the free is an opportunity?.. http://bit.ly/aHpeat
Posted 17 August 2011 - 05:38 PM
This worked for me. I tried it while working on the new members area at LA Fitness. Didn't think it would, but it did.
Posted 20 September 2011 - 02:28 AM
If your server has PHP you can simply rename your pages with a .php extension replacing the .html and put this line of code wherever you wish to include the one piece of data that you want to keep separate:
<?php include_once 'your filename here'; ?>
Teaching Photography in Chicago ipaschools.com
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users