Web Analytics Made Easy -
StatCounter load image - CodingForum

Announcement

Collapse
No announcement yet.

load image

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new 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
    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')">
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

    Comment


    • #3
      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)">
      De gustibus non est disputandum.

      Comment


      • #4
        lol.....see I was tired last night when I typed that!!
        Thanks for seeing that mistake...lol....sleep is good
        Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

        Comment

        Working...
        X