Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

brain fade - how to include one html file in anther?

Thread Tools
 
Search this Thread
 
Old 31 May 2002, 04:50 PM
  #1  
DazV
Scooby Regular
Thread Starter
 
DazV's Avatar
 
Join Date: Jun 2000
Posts: 3,783
Likes: 0
Received 0 Likes on 0 Posts
Post

Let me explain, lets say the header of every page on my site doesn't change, so instead of putting the full code that makes up the header, into every page, I want a reference to 'header.html' in each page instead.

What the heck is the tag name again ?

DOH!

-DV


[Edited by DazV - 5/31/2002 4:51:10 PM]
Old 31 May 2002, 04:57 PM
  #2  
chiark
Scooby Regular
 
chiark's Avatar
 
Join Date: Jun 2000
Posts: 13,735
Likes: 0
Received 0 Likes on 0 Posts
Post

Using server side includes is the only way I know of apart from using frames, which are the work of the devil.

SSI depends on your ISP's technology. For ASP it's just <!--#include virtual="filename" -->

Hope this helps.
Old 31 May 2002, 05:01 PM
  #3  
DazV
Scooby Regular
Thread Starter
 
DazV's Avatar
 
Join Date: Jun 2000
Posts: 3,783
Likes: 0
Received 0 Likes on 0 Posts
Post

oh bugger, thought I could do it with html.

thanks for the info.
Old 31 May 2002, 05:11 PM
  #4  
Iain Young
Scooby Regular
 
Iain Young's Avatar
 
Join Date: Sep 1999
Location: Swindon, Wiltshire Xbox Gamertag: Gutgouger
Posts: 6,956
Likes: 0
Received 0 Likes on 0 Posts
Post

Might be an easier way, but how about putting the header into a bit of javascript with "document.write" commands and just including it with the <script language="javascript" src="thingy.js">

(p.s. I can't remember the exact syntax for the javascript call, but I have done it before so know it works - have a look on http://javascript.internet.com and you should find an example)

Hope this helps...

Iain
Old 31 May 2002, 05:13 PM
  #5  
Dream Weaver
Scooby Regular
 
Dream Weaver's Avatar
 
Join Date: Feb 2000
Location: Lancashire
Posts: 9,844
Received 0 Likes on 0 Posts
Thumbs up

Daz

You could always use an iFrame tag. Similar to frames, but you dont have to mess about with framesets etc.

You have your main page, say index.html, then place the tags where you want the frame:

<iframe src="content.html" border="0" scroll="auto"></iframe>

etc etc

Works well

DW
Old 31 May 2002, 05:31 PM
  #6  
chiark
Scooby Regular
 
chiark's Avatar
 
Join Date: Jun 2000
Posts: 13,735
Likes: 0
Received 0 Likes on 0 Posts
Post

aah, that's the bunny.

i just always use the server side stuff oops!
Old 31 May 2002, 05:35 PM
  #7  
Hos
Scooby Regular
iTrader: (1)
 
Hos's Avatar
 
Join Date: Jul 1999
Location: Dundee
Posts: 978
Likes: 0
Received 0 Likes on 0 Posts
Post

You can do it easy enough in normal frames with no border and editing the size.

but you don't really need as the last post got it spot on.
iframes method is great.
Old 31 May 2002, 05:37 PM
  #8  
Dream Weaver
Scooby Regular
 
Dream Weaver's Avatar
 
Join Date: Feb 2000
Location: Lancashire
Posts: 9,844
Received 0 Likes on 0 Posts
Thumbs up

iFrames are , though dont work on older browsers.

Normal Frames are nasty - steer clear DV

DW
Old 31 May 2002, 05:42 PM
  #9  
Hos
Scooby Regular
iTrader: (1)
 
Hos's Avatar
 
Join Date: Jul 1999
Location: Dundee
Posts: 978
Likes: 0
Received 0 Likes on 0 Posts
Post

dunno if this helps you too, but to create a frames page in a table... sample code..

<TR><TD colSpan=2><IFRAME name=htmlpage=center
src="http://youraddresstofile.htm" frameBorder=0
width="100%" height=130></IFRAME></TD>
Old 31 May 2002, 06:00 PM
  #10  
DazV
Scooby Regular
Thread Starter
 
DazV's Avatar
 
Join Date: Jun 2000
Posts: 3,783
Likes: 0
Received 0 Likes on 0 Posts
Post

Thanks all, the iframe tag looks good, but I'm trying to follow amazon's blueprint in putting out an e-commerce site thats simple and suitable enough for all browsers so thanks Dreamweaver for the tip-off that iframes won't work in all browsers.

Thanks for the example HOS

I'm going to incorporate some coldfusion so I'll dig out the equialent to chiark's ASP version.

Thanks again all.

-DV
Old 01 June 2002, 09:51 AM
  #11  
Dream Weaver
Scooby Regular
 
Dream Weaver's Avatar
 
Join Date: Feb 2000
Location: Lancashire
Posts: 9,844
Received 0 Likes on 0 Posts
Thumbs up

Daz

Double check it first though as it may only be stuff like Netscape/IE 3 etc that they dont work in and not many people use them these days

DW
Old 01 June 2002, 12:56 PM
  #12  
snowcrash
Scooby Regular
 
snowcrash's Avatar
 
Join Date: Mar 2002
Location: www.scoobyzone.co.uk
Posts: 2,082
Likes: 0
Received 0 Likes on 0 Posts
Post

the javascript way (mentioned above) is proberbly the best - as its support by nearly all broswers....

Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
shorty87
Full Cars Breaking For Spares
19
22 December 2015 11:59 AM
B0DSKI
Non Car Related Items For sale
2
27 September 2015 06:58 PM
Nick_Cat
Computer & Technology Related
2
26 September 2015 08:00 AM
shorty87
Other Marques
0
25 September 2015 08:52 PM
Littleted
Computer & Technology Related
0
25 September 2015 08:44 AM



Quick Reply: brain fade - how to include one html file in anther?



All times are GMT +1. The time now is 02:58 PM.