Trying to create server-refreshed table cells (iframe maybe?)

liunx

Guest
Hi,<br />
<br />
I have a form that I would like to have certain fields of a table refresh every few seconds.<br />
<br />
One convenient way I thought about tackling this was to have an IFRAME in each cell that I want refreshed, and force a location refresh on it.<br />
<br />
I started out with this approach, but the IFRAME I want is just an input item and Im having a size problem. The frame wants to be huge.<br />
<br />
My main page:<br />
<br />
<FORM><br />
<TABLE><br />
<TR><br />
<TD><IFRAME FRAMEBORDER="1" ALIGN="TOP" SCROLLING="no" src=http://www.webdeveloper.com/forum/archive/index.php/"test.htm" height="24" width="150"></IFRAME></TD><br />
</TR><br />
</TABLE><br />
</FORM><br />
<br />
<br />
test.htm:<br />
<input type="TEXT" value="Hello World" marginwidth="0" marginheight="0"><br />
<br />
<br />
If you try this you will see the IFRAME bound by its height and width, but the test.htm page has a margin around it, so you can barely see the hello world item.<br />
<br />
Im definitely not an expert on HTML, is there a way to create a page that an IFRAME will load and fit exactly into the space it is provided?<br />
<br />
Thanks,<br />
Doug<!--content-->I think I understand what you want. You can use CSS and margin on the HTML elements you want to have no margin:<br />
<br />
<br />
<body style="margin:0px;"><br />
<br />
<br />
Try adding that to the source page in the iframe, and if you need the iframe to take up all the space of the table cell, add the style bit to the <td> too.<!--content-->Hey, that works great!<br />
<br />
Rick, you're too helpful. Now I have to ask you another question :)<br />
<br />
If in the provided example, I wanted javascript to issue a location.reload() on the IFRAME only, is that possible?<br />
<br />
Im trying to get the location object to issue a reload, but am stumped at how to obtain a reference to it from the main javascript body.<br />
<br />
If you have any insight in this I would appreciate it<br />
<br />
Thanks,<br />
Doug<!--content-->I think I figured one way to do it:<br />
<br />
document.frames("myiframe").document.location.reload();<br />
<br />
<br />
Unfortunately the location field of document is deprecated....<br />
<br />
<br />
edit: take two....NOT deprecated :)<br />
<br />
document.frames("myiframe").window.location.reload();<!--content-->
 
Back
Top