How can I dynamically embed other html documents in one page (HTML)?

Kajhskdja

New member
Hello,

I have come across the frames/frameset, but this seem to be dodgy and a nightmare to layout-connect html documents altogether. Simply because these are not given the adequate css properties to play with (or am I missing something?).
I want to make a banner and a footer that is static and always stays in the same page, however my content/data/text has to be dynamic and should load into a page space between header/footer whenever I navigate. What is the best way/method to pursue this?
Whoever is keen to help - god bless you.
 
There are a number of options:

1. HTML Server Side Include: http://www.javascriptkit.com/howto/ssi.shtml
2. PHP Server Side Include: http://www.w3schools.com/PHP/php_includes.asp
3. ASP.NET Server Side Include: http://www.w3schools.com/asp/asp_incfiles.asp
4. Client Side Include (aka AJAX): http://www.w3schools.com/ajax/default.asp

Regardless of which method you choose, you'll have to position your header and footer with DIV tags: http://www.w3schools.com/tags/tag_DIV.asp
 
I *think* I know what you mean, which is a consistent banner/footer on each page of a website, with different content on each page. You're pattern-matching in your head. Yup, I did that, too.

The best way is to go ahead and bite the bullet and hard-code the header and footer on each page. It's shorter and simpler and sweeter and far more efficient (sit back and think about it for a moment!) than any other method. Why? The person about whom you should be concerned isn't YOU but the website visitor! The less code THEY have to download, and run on their machine (like an extra javascript to go fetch a copy of a header/footer that would be there, anyway) the better. Especially if, maybe, they have javascript disabled!

So, just put the code in there. Then, if you ever need to change header/footer, you can use global change functions in your html editor to change those areas of your files. Use CSS with cascades (that's the C) and classes and IDs to style the header and footer appropriately! Gitter done!
 
There are a number of options:

1. HTML Server Side Include: http://www.javascriptkit.com/howto/ssi.shtml
2. PHP Server Side Include: http://www.w3schools.com/PHP/php_includes.asp
3. ASP.NET Server Side Include: http://www.w3schools.com/asp/asp_incfiles.asp
4. Client Side Include (aka AJAX): http://www.w3schools.com/ajax/default.asp

Regardless of which method you choose, you'll have to position your header and footer with DIV tags: http://www.w3schools.com/tags/tag_DIV.asp
 
There are a number of options:

1. HTML Server Side Include: http://www.javascriptkit.com/howto/ssi.shtml
2. PHP Server Side Include: http://www.w3schools.com/PHP/php_includes.asp
3. ASP.NET Server Side Include: http://www.w3schools.com/asp/asp_incfiles.asp
4. Client Side Include (aka AJAX): http://www.w3schools.com/ajax/default.asp

Regardless of which method you choose, you'll have to position your header and footer with DIV tags: http://www.w3schools.com/tags/tag_DIV.asp
 
There are a number of options:

1. HTML Server Side Include: http://www.javascriptkit.com/howto/ssi.shtml
2. PHP Server Side Include: http://www.w3schools.com/PHP/php_includes.asp
3. ASP.NET Server Side Include: http://www.w3schools.com/asp/asp_incfiles.asp
4. Client Side Include (aka AJAX): http://www.w3schools.com/ajax/default.asp

Regardless of which method you choose, you'll have to position your header and footer with DIV tags: http://www.w3schools.com/tags/tag_DIV.asp
 
There are a number of options:

1. HTML Server Side Include: http://www.javascriptkit.com/howto/ssi.shtml
2. PHP Server Side Include: http://www.w3schools.com/PHP/php_includes.asp
3. ASP.NET Server Side Include: http://www.w3schools.com/asp/asp_incfiles.asp
4. Client Side Include (aka AJAX): http://www.w3schools.com/ajax/default.asp

Regardless of which method you choose, you'll have to position your header and footer with DIV tags: http://www.w3schools.com/tags/tag_DIV.asp
 
Back
Top