| re: Alternative Image
What garble are you talking about ?
Image loads or not and will not error otherwise.
I you need to event monitor higher stuff,
it may be too late.
What error? Do your local newspaper's photos
make noises when you pull a copy form the vending box.
Which one you thought ?
How is your noisy cartoon and TV replacement of a childhood
and education playing out after all ?
"Alternative Image"
There is no such thing. I means otherwise, how e.g. blind people
ought to be presented an idea of an "invisible picture"
in TEXTUAL representation.
And that must not make an error or noise on demand only.
You sure are not an eye dog in this group.
"Thomas 'PointedEars' Lahn" <PointedEars@web.de> wrote in message
news:1188121.KGGzIapAWZ@PointedEars.de...[color=blue]
> joe wrote:
>[color=green]
> > Ok. I think I found a solution:
> >
> > <img src="orig_image.jpg" onerror="this.src='alt_image.jpg';">[/color]
>
> This is not a standards compliant solution, though. The `img' element
> does not have an `onerror' attribute in Valid (X)HTML markup, and the
> `alt' attribute is required. A standards compliant solution, taking
> into account additional DOM features, could be
>
> <!-- Transitional HTML or XHTML DOCTYPE, else use `id' instead of[/color]
`name' -->[color=blue]
> <html>
> <head>
> ...
> <meta http-equiv="Content-Script-Type" content="text/javascript">
> <script type="text/javascript">
> function replaceOnError(img, alt_src)
> {
> if (typeof img.onerror != "undefined")
> {
> img.onerror = function()
> {
> this.src = alt_src;
> return true;
> }
> }
> }
> </script>
> ...
> </head>
>
> <body onload="replaceOnError(document.images['foo'], 'alt_image.jpg');">
> ...
> <img src="orig_image.jpg" alt="foo" name="foo">
> ...
> </body>
> </html>
>
> But you rather should consider the ErrorDocument directive of httpd
> compatible Web servers (like the Apache HTTP Server) which will also
> work without client-side script support.
>
>
> PointedEars[/color] |