Rooseboom
07-03-2002, 11:49 AM
I have got the following code in my header:
<script language="JavaScript">
function doClick(thePage,layerName) {
if (document.layers) {
txtResult = document.layers[layerName];
txtTestResult = document.layers['idResult'];
} else if (document.all) {
txtResult = document.all(layerName);
txtTestResult = document.all('idResult');
}
txtResult.innerHTML = " <font color=\"#C02A2B\" size=\"1\"> [ opening... ]</font>";
document.pageDisplay.idURL.value = thePage;
txtTestResult.src="check.php?url=" + thePage;
}
function dummy() {
}
function OnResult() {
if (document.layers) {
txtTestResult = document.layers['idResult'];
} else if (document.all) {
txtTestResult = document.all('idResult');
}
if (txtTestResult.src != "") {
if (idResult.Success()) {
txtResult.innerHTML = " <font color=\"#C02A2B\" size=\"1\"> [ opening... ]</font>";
window.open(document.pageDisplay.idURL.value, "preview");
} else {
txtResult.innerHTML = " <font color=\"#C02A2B\" size=\"1\"> [document unavailable! ]</font>";
}
}
}
</script>
and call this in the body like so:
<td>
1. <a href="#1" onclick="doClick('http://www.url.com','resultLayer1')" id="link1">Link title</a>
</td>
<td>
<div id="resultLayer1"></div>
</td>
It works fine on IE 6 but on IE 5 it doesn't work :( (haven't tested it on other browser since I haven't got them)
Is something wrong with the code?
<script language="JavaScript">
function doClick(thePage,layerName) {
if (document.layers) {
txtResult = document.layers[layerName];
txtTestResult = document.layers['idResult'];
} else if (document.all) {
txtResult = document.all(layerName);
txtTestResult = document.all('idResult');
}
txtResult.innerHTML = " <font color=\"#C02A2B\" size=\"1\"> [ opening... ]</font>";
document.pageDisplay.idURL.value = thePage;
txtTestResult.src="check.php?url=" + thePage;
}
function dummy() {
}
function OnResult() {
if (document.layers) {
txtTestResult = document.layers['idResult'];
} else if (document.all) {
txtTestResult = document.all('idResult');
}
if (txtTestResult.src != "") {
if (idResult.Success()) {
txtResult.innerHTML = " <font color=\"#C02A2B\" size=\"1\"> [ opening... ]</font>";
window.open(document.pageDisplay.idURL.value, "preview");
} else {
txtResult.innerHTML = " <font color=\"#C02A2B\" size=\"1\"> [document unavailable! ]</font>";
}
}
}
</script>
and call this in the body like so:
<td>
1. <a href="#1" onclick="doClick('http://www.url.com','resultLayer1')" id="link1">Link title</a>
</td>
<td>
<div id="resultLayer1"></div>
</td>
It works fine on IE 6 but on IE 5 it doesn't work :( (haven't tested it on other browser since I haven't got them)
Is something wrong with the code?