Click to See Complete Forum and Search --> : Importing an html to an html


jihaes
01-16-2003, 02:32 PM
Hi,
I have been using cold fusion and if you are not familiar with CF, it's another programming language that deals with MS access and other things and in that code we have <cf template > where you can call in another page to be desplayied in the current page.
It's useful when you have many pages on the web and have a menu bar with many links so you dont have to change everypage if one link changes.
I was wondering if there is a similar way to do the same thing using javascript.

If you know or if no such thing exists, please reply to this. That'd be great.

Thank you
Jihae.

PS. I'm trying to find a way without changing the file extension. to keep html file html.

pyro
01-16-2003, 03:41 PM
Well, you could do it in javascript, but that will make your pages unaccessable to 10% of internet users. Better of to change the extention and use PHP or SSI...but since you didn't want to...

Make an external .js called header.js.

document.write('
'<html>',
'<head>',
'<title>Your Title</title>',
'<body>');

That could be a header used on all pages.

Then you'd do this to generate a full page..

<script type="text/javascript" src="header.js"></script>
<p> more html
</body>
</html>