Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jul 2002
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 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
    New Coder
    Join Date
    Jul 2002
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #3
    New Coder
    Join Date
    Jul 2002
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    New Coder
    Join Date
    Jul 2002
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •