Connecting Tech Pros Worldwide Forums | Help | Site Map

best way to load new page into a table?

Newbie
 
Join Date: Oct 2006
Location: Newcastle
Posts: 8
#1: Oct 21 '06
Hi All,
say i have a table like so

<table>
<tr>
<td>header.jpg</td>
<tr>
<td>><div id="myDiv"> text window </div></td>
<tr>
<td>footer.jpg</td>

with 2 links at the bottom of the page
NEWS
CONTACT

I would like to know what would be the best way to construct is so, when the user clicks on either 'news' or 'contact' , the relating file [news.htm or contact.htm] is opened & displayed in that <TD> text window ?.

i have been told to use the following function:

function changeText(newText){
document.getElementById("test").in* nerHTML=]newText
}

<a href="#" onClick=document.getElementById("m* yDiv").innerHTML="news.htm"> NEWS </a>



however , this function expects a string of text.
What i'd prefer is a function that will open the .html file , & display its contents

Would anyone have some advice on this ?.
Thanks

Newbie
 
Join Date: Oct 2006
Location: Canada
Posts: 5
#2: Oct 21 '06

re: best way to load new page into a table?


The best way I've found is using what are called inline frames, or iFrames.
I'm by no means an expert on the subject, but here's the tutorial I learned from.

http://www.yourhtmlsource.com/frames/inlineframes.html
Newbie
 
Join Date: Oct 2006
Location: Newcastle
Posts: 8
#3: Oct 21 '06

re: best way to load new page into a table?


Quote:

Originally Posted by Wolff

The best way I've found is using what are called inline frames, or iFrames.
I'm by no means an expert on the subject, but here's the tutorial I learned from.

http://www.yourhtmlsource.com/frames/inlineframes.html

Thanks Wollf,
however , i have already built my site around a table & would like to use JS to implement a files text into a cell.

Thanks though , i've had a flick through that tutorial.
napalm
Newbie
 
Join Date: Oct 2006
Location: Newcastle
Posts: 8
#4: Oct 21 '06

re: best way to load new page into a table?


Sorry Wollf
after reading a bit more into it [new to it myself] thats exactly what i needed

it shows i didnt know what i was talking about haha
Thanks
napalm
Reply