Calling html code from an external document

They have: 2 posts

Joined: Dec 2004

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.

comedownmonday.co.za

Busy's picture

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

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?

He has: 153 posts

Joined: Nov 2004

Never mind i figured it out sorry Smiling

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.