...

View Full Version : Script runs on IE 6 but not 5



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\"> &nbsp;&nbsp;[ 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\"> &nbsp;&nbsp;[ opening... ]</font>";
window.open(document.pageDisplay.idURL.value, "preview");
} else {
txtResult.innerHTML = " <font color=\"#C02A2B\" size=\"1\"> &nbsp;&nbsp;[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?

Rooseboom
07-04-2002, 09:08 AM
Nobody can give me some hints? The code is not correct, that much I know...but I haven't got a clue on what is wrong.

Plz, some help is needed....thx

Rooseboom
07-05-2002, 08:07 AM
Uhm.....is this what you are saying(?):

txtResult = document.all(layerName);
txtTestResult = document.all('idResult');

should become:

txtResult = document.all[layerName];
txtTestResult = document.all['idResult'];

??

thx for helping

Rooseboom
07-05-2002, 12:58 PM
lol, haven't been able to apply it yet. I will do so this evening and test it....

if it doesn't work, i know where to find ya ;)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum