View Full Version : Code Help


clugenheim
12-26-2006, 08:29 AM
Ok. I need help with some coding. ( Hence the thread title. ;) )

So, what this code is, is a code for tabs.

The problem is, that when a site loads in the tab, I want the site title to appear inside of it. But all that shows up is "Loading..." even after the page stops loading.

Here is the code:

function newTab() {
url="http://"+document.getElementById('newURL').value;
tabNum++;
document.getElementById('tabnav').innerHTML = document.getElementById('tabnav').innerHTML + "<li id=\"tab"+tabNum+"\"><a href=\"#\" id=\""+tabNum+"\" onClick=\"javascript:change("+tabNum+");\">Loading...</a></li>";
document.getElementById('frames').insertAdjacentHT ML('beforeEnd',"<iframe src=\""+url+"\" width=\"100%\" height=\"96%\" frameborder=\"0\" id=\"frame"+tabNum+"\"></iframe>");
change(tabNum);
document.getElementById('urlinput').style.display="none";
document.getElementById('container').style.display ="";
document.getElementById('newURL').value="";
var req=new IFramelHttpRequest();
req.onload=function(){
document.getElementById(tabNum).innerHTML=this.res ponseXML.document.getElementById('title').innerHTM L;
}
req.open("get","gettitle.php?url="+url);

Any ideas?

Oh. BTW, if you have no freaking idea what I'm talking about, go here:
http://fc-channel.1111mb.com/Tabs.html and click the new tab icon, type in a URL, and you'll see exactly what I mean.

EDIT: Shiz. I believe I put this in the wrong forum.. please move. -_-