favicon keeps reload

Discussion in 'JavaScript' started by larrson, Apr 11, 2007.

  1. #1
    when implement swapping images, the mouseover will activate the java script, yes, everything works fine. But the problem is that when each mouseover activates swapping, my favicon on the url will reload.
    How can I make the favicon a static icon while swapping is running?
    what kind of special tags that I need to use?am I missing something?thanks ..
     
    larrson, Apr 11, 2007 IP
  2. briansol

    briansol Well-Known Member

    Messages:
    221
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    110
    #2
    i've never seen or heard of this before ever. lol

    can you post some code?
     
    briansol, Apr 11, 2007 IP
  3. larrson

    larrson Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>red to blue swap image</title>
    <link rel="icon" href="/images/favicon.ico" type="image/x-icon">
    <link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
    </head>

    <a href="" name= link1 onMouseOver = "ImgOver()" onMouseOut = "ImgOut()">
    <IMG NAME = "IMG1" SRC = "images/red.png" width ="100" height="100">
    </a>


    <SCRIPT LANGUAGE= JavaScript>
    function ImgOver()
    {
    document.IMG1.src = 'images/blue.png';
    }

    function ImgOut()
    {
    document.IMG1.src = 'images/red.png';
    }
    </SCRIPT>

    </body>
    </html>
     
    larrson, Apr 11, 2007 IP
  4. larrson

    larrson Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    when i try to run this on opera 9.1, the favicon reload again when either mouse out or mouse over occurs.
    but when running in mozilla everything is ok.
    so question is how to make it compatible within this two internet browsers?
     
    larrson, Apr 12, 2007 IP
  5. Logic Ali

    Logic Ali Well-Known Member

    Messages:
    170
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    108
    #5
    Don't use href="" use href="#" and if you have an onclick handler, make it return false.
     
    Logic Ali, Apr 13, 2007 IP