![]() |
|
|
|||||||
![]() |
HTML - Newbie Question: How can I link to some HTML in another page? |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
For example let's say I have a file called "file1.htm" that contains the
following data... <table> <tr><td>hello</td></tr> </table> ....Now let's say I want to make a file and link it so the "file1.htm" file like this... <html> <body> <h2>hello</h2> <<<<link this section to the FILE1.HTM file>>>> </body> </html> ....How would I do that? Would it be something like this?... <html> <body> <h2>hello</h2> <http://www.mydomain.com/file1.htm> </body> </html> michaaal |
|
|
|
|
#2 |
|
Posts: n/a
|
michaaal wrote:
> For example let's say I have a file called "file1.htm" that contains > the following data... > > <table> > <tr><td>hello</td></tr> > </table> > > ...Now let's say I want to make a file and link it so the "file1.htm" > file like this... > > <html> > <body> > <h2>hello</h2> > <<<<link this section to the FILE1.HTM file>>>> > </body> > </html> > > ...How would I do that? Would it be something like this?... > > <html> > <body> > <h2>hello</h2> > <http://www.mydomain.com/file1.htm> > </body> > </html> <html> <body> <h2>hello</h2> <a href="http://www.mydomain.com/file1.htm">My File 1</a> </body> </html> Or did you mean that you want to include the contents of file1.htm at that point in the second file? |
|
|
|
#3 |
|
Posts: n/a
|
Nik Coughin wrote:
> michaaal wrote: >> For example let's say I have a file called "file1.htm" that contains >> the following data... >> >> <table> >> <tr><td>hello</td></tr> >> </table> >> >> ...Now let's say I want to make a file and link it so the "file1.htm" >> file like this... >> >> <html> >> <body> >> <h2>hello</h2> >> <<<<link this section to the FILE1.HTM file>>>> >> </body> >> </html> >> >> ...How would I do that? Would it be something like this?... >> >> <html> >> <body> >> <h2>hello</h2> >> <http://www.mydomain.com/file1.htm> >> </body> >> </html> > > <html> > <body> > <h2>hello</h2> > <a href="http://www.mydomain.com/file1.htm">My File 1</a> > </body> > </html> > > Or did you mean that you want to include the contents of file1.htm at > that point in the second file? That looks screwy in Outlook Express. When I look at the message source there's nothing wrong with it. It should look like (without the extra spaces): < a h r e f = " h t t p : / / w w w . m y d o m a i n . c o m / f i l e 1 .. h t m " > M y F i l e 1 < / a > |
|
|
|
#4 |
|
Posts: n/a
|
On Tue, 27 Apr 2004 04:10:02 GMT, "michaaal" <>
declared in alt.html: > ...Now let's say I want to make a file and link it so the "file1.htm" file > like this... http://www.allmyfaqs.com/faq.pl?Incl...ile_in_another BTW: http://www.allmyfaqs.com/faq.pl?Tableless_layouts -- Mark Parnell http://www.clarkecomputers.com.au |
|
|
|
#5 |
|
Posts: n/a
|
> http://www.allmyfaqs.com/faq.pl?Incl...ile_in_another
Yes, Mark, this is what I am talking about. But how can you do it with just straight HTML and not do it. So far, I have found this method... <frameset> <frame src="http://www.yahoo.com"> </frameset> Is this the best way to do this? |
|
|
|
#6 |
|
Posts: n/a
|
On Tue, 27 Apr 2004 06:07:55 GMT, "michaaal" <>
declared in alt.html: > Yes, Mark, this is what I am talking about. But how can you do it with just > straight HTML and not do it. You can't. HTML doesn't *do* anything. It is a markup language - it simply describes the structure of the content. Eventually you will probably want server-side scripting, and most server-side languages have some form of includes built it. Even if you don't have access to server-side scripting, any decent host will offer SSI (and you may be able to use it even if they don't think you can), and even if they don't you can always use a preprocessor. > <frameset> > <frame src="http://www.yahoo.com"> > </frameset> *<shudder>* There is certainly no need to resort to that sort of heresy. http://html-faq.com/htmlframes/?framesareevil http://homepage.ntlworld.com/l_vajzo...eb/frames.html http://dorward.me.uk/www/frames/ http://www.google.com/webmasters/2.html (see under "Your page uses frames") -- Mark Parnell http://www.clarkecomputers.com.au |
|
|
|
#7 |
|
Posts: n/a
|
"michaaal" <> wrote in message news:%Mmjc.41719$... > > http://www.allmyfaqs.com/faq.pl?Incl...ile_in_another > > Yes, Mark, this is what I am talking about. But how can you do it with just > straight HTML and not do it. > > So far, I have found this method... > > <frameset> > <frame src="http://www.yahoo.com"> > </frameset> > > > Is this the best way to do this? Frames are *not* the best way to go - while they work, it's a bad path to start walking down for a n00b as they can lead to all kinds of complications. There are times and places for frames, but not until you understand the consiquences of using them. The single best way to include one file inside another is to use a server-side include. Assuming your server supports ASP (basically, if you are using a Microsoft webserver called "Internet Information Server", or IIS) this is achieved fairly painlessly; <!--#include file="folder/file.htm" --> The folder can be anywhere inside your website, and the file can be any text file (such as .htm, .asp, .txt). The contents of the file are "added" to the page by the server *before* the page is sent to the users browser, so they will have no indication that included files were used to stick your page together. An include can be placed *anywhere* inside your HTML document. <p>some stuff <br /> another line </p> <hr /> <!--#include file="folder/file.htm" --> <hr /> <p>more stuff</p> |
|
|
|
#8 |
|
Posts: n/a
|
"Nik Coughin" <nrkn!no-spam!@woosh.co.nz> wrote:
> That looks screwy in Outlook Express. What "that"? Please quote the relevant part only, or otherwise make your references clear. Also please use descriptive words, not emotional. > It should look like (without > the extra spaces): > > < a h r e f = " h t t p : / / w w w . m y d o m a i n . c o m / f i > l e 1 . h t m " > M y F i l e 1 < / a > <marquee>Then why do you use extra spaces?</marquee> <font size="7" color="red" face="Verdana"> If your newsreader surrogate interprets HTML tags in Usenet messages, fix its settings, or get a decent newsreader.</font> <iframe title="Here I could have put some nasty code that crashes OE" src="..."> </iframe> -- Yucca, http://www.cs.tut.fi/~jkorpela/ Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html |
|
|
|
#9 |
|
Posts: n/a
|
Jukka K. Korpela wrote:
> <iframe title="Here I could have put some nasty code that crashes OE" > src="..."> > </iframe> Or even more fun... begin hiding Nobody using OE can see me. -- Toby A Inkster BSc (Hons) ARCS Contact Me - http://www.goddamn.co.uk/tobyink/?page=132 |
|