Calling html code from an external document
I need to regularly replace a segment of html and dhtml on my website. It is a section which details the latest updates and is used on all pages of the website. Whenever I update the site, all of the pages have to contain the updated info, and its a mission to update and upload all the pages with the new menu.
Is there a way to reference a segment of code from an external document or script file that I can call by name and will display the desired code.(sort of like a method of function but displaying html) I would therefore only have to change the code in the script file and not have to update all pages to display the new info.
Thanks,
ian.
Busy posted this at 22:54 — 6th December 2004.
He has: 6,151 posts
Joined: May 2001
since you're using dhtml, include via javascript. just place the html in a document.write section, very similar to including server side stuff
include header.js
page contents
include footer.js or whatever
TaylorAtCTS posted this at 23:02 — 6th December 2004.
He has: 153 posts
Joined: Nov 2004
I would like to do this to, all my opahes are in plain html but i use javascript.. how do i do it?
TaylorAtCTS posted this at 23:11 — 6th December 2004.
He has: 153 posts
Joined: Nov 2004
Never mind i figured it out sorry
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.