HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 7th, 1999, 09:43 PM
Damian
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
I have a footer in html format that is in all my pages, how can I do to include it in my pages without re-typing it?

Thanks in advance.

Reply With Quote
  #2  
Old November 8th, 1999, 06:05 PM
scollo
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Are you using any kind of server-side programming like PHP?

Reply With Quote
  #3  
Old November 11th, 1999, 08:42 PM
sawz
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
I wanted to do the same thing as I have several pages that have the same footer.

Instead of using ssi, (didn't want to change the extensions of all my pages) I used a java script to deliver the footer to these pages.

Now if I have to make a change, I change it on the one doc and it affects all my pages.


Reply With Quote
  #4  
Old November 14th, 2000, 08:32 PM
Fahad Fahad is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Posts: 2 Fahad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
sawz,

Would you be kind to tell us how it can be done in JavaScript? I need to display graphics and tables as a common left-hand side menu pannel.

<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by sawz:
I wanted to do the same thing as I have several pages that have the same footer.

Instead of using ssi, (didn't want to change the extensions of all my pages) I used a java script to deliver the footer to these pages.

Now if I have to make a change, I change it on the one doc and it affects all my pages.

[/quote]


Reply With Quote
  #5  
Old November 15th, 2000, 04:19 AM
stardotstar stardotstar is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Posts: 63 stardotstar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
If you goto the post called "include file" it should help with what you are trying to do.

Or just click http://www.devshed.com/Talk/Forums/...TML/000162.html to go straight to the post.

Reply With Quote
  #6  
Old November 17th, 2000, 09:59 AM
dorward's Avatar
dorward dorward is offline
Coder
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Posts: 23 dorward User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by Fahad:
sawz,

Would you be kind to tell us how it can be done in JavaScript? I need to display graphics and tables as a common left-hand side menu pannel.

[/quote]

If you use JS to do it you will run in to massive problems when people who turn JS off visit your site. Take a look at http://www.dorward.co.uk/dolt.html

I know its a shameless bit of self promotion.

But the best way is SSI: http://www.bignosebird.com/ssi.shtml

Reply With Quote
  #7  
Old November 23rd, 2000, 02:05 PM
rinadib rinadib is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 8 rinadib User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Most internet sites these days rely heavily on Javascript!! I think most users would rather enable their javascript (a 1 time 1 mintute step) than unecessarily wait for the server to come back as with SSIs.
So I would recommend use of Javascript whenever and wherever possible.
To do this in Javascript, use this wherever you want to include your footer:
document.write('<SCRIPT LANGUAGE="JavaScript" SRC="x.js"></SCRIPT>');

where x.js is another javasctipt that just writes the HTML for the footer, eg

document.write(<footer_html> );

Hope that was helpful.

Irene
PS this may not work as is if you are using layers!!

Reply With Quote
  #8  
Old December 1st, 2000, 11:17 AM
FieroEtnl FieroEtnl is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Location: Omaha
Posts: 5 FieroEtnl User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to FieroEtnl Send a message via AIM to FieroEtnl
If you want to use SSI, in particular PHP, you can use this little bit of code to include the footer in all of your pages:

<?php
include(footer.html);
?>

Then all you have to do is make the stuff in the footer file the footer, and voila! Only problem is you have to have PHP enabled on the server for this to work.

Michael

Reply With Quote
  #9  
Old December 1st, 2000, 06:16 PM
colin_anderson colin_anderson is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 41 colin_anderson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Just responding to rinadib's comment. It is better to use SSI, and there is no slowdown time waiting for the server since it parses it right when requested and then sends it. Unless the server is down, it'll be just as fast and probably a little fast since it wouldn't have to wait for javascript.



------------------
-Colin Anderson
http://www.htmletc.net/
"There are two ways to write error-free programs. Only the third one works."

Reply With Quote
  #10  
Old December 1st, 2000, 06:18 PM
colin_anderson colin_anderson is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 41 colin_anderson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Sorry for the second reply , but FieroEtnl, the code should be:

<?php
include("footer.html");
?>

Reply With Quote
  #11  
Old December 3rd, 2000, 05:12 AM
dorward's Avatar
dorward dorward is offline
Coder
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Posts: 23 dorward User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by rinadib:
I think most users would rather enable their javascript (a 1 time 1 mintute step) than unecessarily wait for the server to come back as with SSIs.
So I would recommend use of Javascript whenever and wherever possible.
[/quote]

Users may not realise that the reason the site does not work is that JavaScript is off

They may not use a webbrowser that has JavaScript available to it.

They may use a speech basd web browser (e.g. becuase they are blind) which does not support JavaScript.

They might decide that reather than suffer popup adverts they would just not visit your site at all.

I would [B]never[/B} make JavaScript a requirement for viewing a website (JavaScript enhancements are fine but everything should degrade smoothly).

Reply With Quote
  #12  
Old December 8th, 2000, 09:13 PM
jc94062 jc94062 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Location: UK
Posts: 50 jc94062 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Or just use frames...
Set the page into frames using the bottom one as the footer and display the rest wherever.

Reply With Quote
  #13  
Old December 9th, 2000, 09:23 PM
ssvr6
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
No offence, but frames are so old and lame. This can be done easily with js or an SSI. Tables load faster than frames and don't cause "layout" problems.

Try some of the js stuff if you can't do SSI(Server Side Includes).

Steve


------------------
Web Application Developer
URL

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > How to include a html code in all my pages?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |