Im using an iframe to display data (recent topics) but im wondering if there is a better way to do this that will not slow page loading as much?

hereis current code

<table width="83%" td align="center" cellspacing="0" id="submenu">
<tr>
<td align=left>

<table width="100%" height="80px" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="row1" width="100%" style="text-align:center"><marquee behavior=scroll direction=up scrollamount=4 onmouseover=this.stop() onmouseout=this.start() id="activetomar"></marquee></td>
</font>
</td></tr></table></td></tr></table>
<script language="javascript" type="text/javascript">
<!--
if(self.location.href.match('http://herproom.5.forumer.com/index.php?act=Search&CODE=getactive')){
actm = document.getElementById('activetomar');
actm.innerHTML += "<table class='tableborder'>Active Topics Removed</table>"
}
else {
document.write("<iframe name='activetopmarq' src='{ibf.script_url}act=Search&CODE=getactive' style='display:none;' onload='latemarqHarvest()'></iframe>");
//-->
function latemarqHarvest()
{
martab = window.frames["activetopmarq"].document.getElementsByTagName("table");
for(var i = 0; i < martab.length; i++){
if(martab[i].className == "tablebasic" && martab[i].parentNode.className == "tableborder"){
tabdiv = martab[i].innerHTML
goingNav(tabdiv)
}
}
}
function goingNav(tabdiv)
{
actm = document.getElementById('activetomar');
actm.innerHTML += "<table class='tableborder'>" + tabdiv + "</table>";
}
}
//-->
</script>

BUMP! Faster way to load/display this? css perhaps?

Bump! some help here please? Anyway to make this function faster? is there a faster way to do this? Its just too slow!

Anyone Know a less time (loading) consuming way to do this?

No. It is still going to load the entire page. Code changes won't speed up data transfer.

The only thing I can think of is to break it into several loads, and display the first one before loading the others.

It dosent display the whole page, only links inside an iframe.

But the browser doesn't know that. It loads everything in the frame before it can render it.

oh could ajax be used to do faster???

Could I use css to display this data?

Why did you ask and answer your own questions? First, why are you using both iframes and tables...redundant much...?

You have to transfer the html, css, JS to the browser...BUT then the JS has to process the data and the iframe content must load... if it is loaded superfluous data prior to JS determining what to show, you have a couple options.... but loose the tables if at all possible...just use CSS to position the iframe...

You can use ajax or you can move some logic to the server, or you can break content into logical groups and have JS on client load smaller pieces, but only what is required for display...
You are using PHP it seems, so the PHP code on the server may also be running slow due design issues...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.