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 2 of 2
  1. #1
    Regular Coder tpeck's Avatar
    Join Date
    Oct 2002
    Location
    Sydney, Australia
    Posts
    877
    Thanks
    53
    Thanked 6 Times in 5 Posts

    image change fails

    I have a function called onload that includes this:

    Code:
    window.onload=new function(){
    
    ...
    
    if (menuletter!=false){
    document.cookie="hddrv="+(menuletter)+"; path=/; expires="+exp.toGMTString();
    document.enterIndex.src='enter2.gif';
    // window.setTimeout("goIndex()",7000);
    // return false;
    }
    ...
    
    }
    
    <img border="0" name="enterIndex" src="enter1.gif" width="413" height="41">
    If I uncomment the two lines and comment the document image swap line, they execute perfectly, so the routine works.

    But if I try to do the image swap instead of the two commented lines, it doesn't swap.

    Of course, the image enter1.gif and enter2.gif exist.

    What am I doing wrong?
    The difference between genius and stupidity is that genius has its limits. (Albert Einstein)

  • #2
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,398
    Thanks
    12
    Thanked 570 Times in 563 Posts
    1. remove the "new" keyword from the onload function
    2. what is menuletter?
    3. what is goIndex() ?


  •  

    Posting Permissions

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