Web Analytics Made Easy -
StatCounter Script runs on IE 6 but not 5 - CodingForum

Announcement

Collapse
No announcement yet.

Script runs on IE 6 but not 5

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Script runs on IE 6 but not 5

    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?

  • #2
    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

    Comment


    • #3
      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

      Comment


      • #4
        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

        Comment

        Working...
        X