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

Thread: load image

  1. #1
    New to the CF scene
    Join Date
    Jul 2002
    Location
    nyc
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    load image

    I've created this function, it will give us more flexibility and I believe it will work in different browsers.

    <SCRIPT LANGUAGE="JavaScript">

    function imageError(theImage)
    {
    document['MisFile'].src="Eyes-01.gif"
    }
    </script>

    </head>

    <body>

    <img name="MisFile" src="WOMENCAN.jpg"
    onerror="imageError(this)">


    </body>

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    couldn't you do this???



    <SCRIPT LANGUAGE="JavaScript">

    function imageError(theImage)
    {
    this.src="Eyes-01.gif"
    }
    </script>

    </head>

    <body>

    <img name="MisFile" src="WOMENCAN.jpg"
    onerror="imageError(this)">


    or even

    onerror="imageError(this.src='hmmm.gif')">

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: load image

    And another suggestion:

    <SCRIPT LANGUAGE="JavaScript">
    function imageError(theImage)
    {
    theImage.src="Eyes-01.gif";
    theImage.onerror = null;
    }
    </script>

    <img name="MisFile" src="WOMENCAN.jpg"
    onerror="imageError(this)">

  • #4
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    lol.....see I was tired last night when I typed that!!
    Thanks for seeing that mistake...lol....sleep is good


  •  

    Posting Permissions

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