Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > alternative image ??

Reply
Thread Tools

alternative image ??

 
 
Sid
Guest
Posts: n/a
 
      04-27-2005
i want a jpg image displayed...but...if the jpg does not exist at the
specified URL, i want another jpg displayed (with a different URL) - i need
a default image displayed in the event of the original image not existing,
or being removed at the server.

I'm aware of IMG alt "alternate text" tag, but having an alternate image
instead of alternative text would do it. is there anyway to do this in a
simple way...and would it cause local cache problems with browers viewing
over the internet...is there a way to force a page rebuild (to eliminate
cache problems).


 
Reply With Quote
 
 
 
 
SpaceGirl
Guest
Posts: n/a
 
      04-27-2005
Sid <simonjenkins@blue wrote:
> i want a jpg image displayed...but...if the jpg does not exist at the
> specified URL, i want another jpg displayed (with a different URL) - i need
> a default image displayed in the event of the original image not existing,
> or being removed at the server.
>
> I'm aware of IMG alt "alternate text" tag, but having an alternate image
> instead of alternative text would do it. is there anyway to do this in a
> simple way...and would it cause local cache problems with browers viewing
> over the internet...is there a way to force a page rebuild (to eliminate
> cache problems).
>
>


You need to think about this differently. How is the image specified?
You could very easily do what you want using serverside scripting. You
CANNOT do this within HTML.
 
Reply With Quote
 
 
 
 
Lauri Raittila
Guest
Posts: n/a
 
      04-27-2005
in alt.html, SpaceGirl wrote:
> Sid <simonjenkins@blue wrote:
> > i want a jpg image displayed...but...if the jpg does not exist at the
> > specified URL, i want another jpg displayed (with a different URL)


> You need to think about this differently.


Perhaps.

> You CANNOT do this within HTML.


He very easily can do it with HTML:

<OBJECT data="first.jpg" type="image/jpeg">
<OBJECT data="second.jpg" type="image/jpeg">
Alternative text
</OBJECT>
</OBJECT>

http://www.w3.org/TR/html4/struct/objects.html#h-13.3

http://www.w3.org/TR/html4/struct/objects.html#h-13.3.1
| If the user agent is not able to render the object for whatever
| reason[...], it must try to render its contents.

I have no idea if it works though... If someone tests it, please tell.

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Utrecht, NL.
Support me, buy Opera:
https://secure.bmtmicro.com/opera/bu...tml?AID=882173
 
Reply With Quote
 
Spartanicus
Guest
Posts: n/a
 
      04-27-2005
"Sid" <simonjenkins@blue<no spam thanks>yonder.co.uk> wrote:

>i want a jpg image displayed...but...if the jpg does not exist at the
>specified URL, i want another jpg displayed (with a different URL) - i need
>a default image displayed in the event of the original image not existing,
>or being removed at the server.
>
>I'm aware of IMG alt "alternate text" tag, but having an alternate image
>instead of alternative text would do it. is there anyway to do this in a
>simple way...and would it cause local cache problems with browers viewing
>over the internet...is there a way to force a page rebuild (to eliminate
>cache problems).


<object type="image/jpeg" data="img.jpg" width="100" height="100">
<object type="image/jpeg" data="altimg.jpg" width="100" height="100">
Sensible text alternative
</object>
</object>

Don't expect it to work in IE though (scrollbars around the element).

--
Spartanicus
 
Reply With Quote
 
Nik Coughin
Guest
Posts: n/a
 
      05-03-2005
Spartanicus wrote:
> "Sid" <simonjenkins@blue<no spam thanks>yonder.co.uk> wrote:
>
>> i want a jpg image displayed...but...if the jpg does not exist at the
>> specified URL, i want another jpg displayed (with a different URL) -
>> i need a default image displayed in the event of the original image
>> not existing, or being removed at the server.
>>
>> I'm aware of IMG alt "alternate text" tag, but having an alternate
>> image instead of alternative text would do it. is there anyway to do
>> this in a simple way...and would it cause local cache problems with
>> browers viewing over the internet...is there a way to force a page
>> rebuild (to eliminate cache problems).

>
> <object type="image/jpeg" data="img.jpg" width="100" height="100">
> <object type="image/jpeg" data="altimg.jpg" width="100"
> height="100"> Sensible text alternative
> </object>
> </object>
>
> Don't expect it to work in IE though (scrollbars around the element).


Doesn't work in IE, FF or Opera.

If img.jpg doesn't exist FF gives me a broken image symbol and Opera shows
nothing. IE... IE is just broken. Shows both with scrollbars.


 
Reply With Quote
 
Spartanicus
Guest
Posts: n/a
 
      05-03-2005
"Nik Coughin" <nrkn!no-spam!@woosh.co.nz> wrote:

>> <object type="image/jpeg" data="img.jpg" width="100" height="100">
>> <object type="image/jpeg" data="altimg.jpg" width="100"
>> height="100"> Sensible text alternative
>> </object>
>> </object>
>>
>> Don't expect it to work in IE though (scrollbars around the element).

>
>Doesn't work in IE, FF or Opera.


Works for me with Moz 1.5, FF 0.9.2 and Opera 6. Opera 7 has an object
bug that regrettably hasn't been fixed in v8.

--
Spartanicus
 
Reply With Quote
 
Travis Newbury
Guest
Posts: n/a
 
      05-03-2005
Spartanicus wrote:
>>><object type="image/jpeg" data="img.jpg" width="100" height="100">
>>> <object type="image/jpeg" data="altimg.jpg" width="100"
>>> height="100"> Sensible text alternative
>>> </object>
>>></object>
>>>Don't expect it to work in IE though (scrollbars around the element).

>>Doesn't work in IE, FF or Opera.

> Works for me with Moz 1.5, FF 0.9.2 and Opera 6. Opera 7 has an object
> bug that regrettably hasn't been fixed in v8.


It seems to me that if it doesn't work in IE, that makes it unusable on
the web. Or you can just accept that 80%+ of your visitors will not
see it correctly.

--
-=tn=-
 
Reply With Quote
 
Leif K-Brooks
Guest
Posts: n/a
 
      05-03-2005
Travis Newbury wrote:
> It seems to me that if it doesn't work in IE, that makes it unusable on
> the web.


MSIE is arguably not a Web browser, so it's perfectly usable on the Web.
 
Reply With Quote
 
Travis Newbury
Guest
Posts: n/a
 
      05-03-2005

Leif K-Brooks wrote:
> > It seems to me that if it doesn't work in IE, that makes it

unusable on
> > the web.

> MSIE is arguably not a Web browser, so it's perfectly usable on the

Web.

No argument there, but (sigh)the second half of my statement is still
true... (0_o)

--
-=tn=-

 
Reply With Quote
 
Nik Coughin
Guest
Posts: n/a
 
      05-05-2005
Spartanicus wrote:
> "Nik Coughin" <nrkn!no-spam!@woosh.co.nz> wrote:
>
>>> <object type="image/jpeg" data="img.jpg" width="100" height="100">
>>> <object type="image/jpeg" data="altimg.jpg" width="100"
>>> height="100"> Sensible text alternative
>>> </object>
>>> </object>
>>>
>>> Don't expect it to work in IE though (scrollbars around the
>>> element).

>>
>> Doesn't work in IE, FF or Opera.

>
> Works for me with Moz 1.5, FF 0.9.2 and Opera 6. Opera 7 has an object
> bug that regrettably hasn't been fixed in v8.


Ah OK. Didn't try Moz, and I am running FF 1.02 and Opera 7.54, so there we
go.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SMIL (video+image+text) alternative for Java Ɓukasz M. Java 0 05-13-2010 01:42 PM
Quicktime Alternative, RealPlayer Alternative & Media Player Classic John Capleton Computer Support 3 12-05-2005 07:41 AM
Alternative Image joe Javascript 4 05-25-2005 04:18 PM
Image Map: Acceptable alternative to frames? (Pete Cresswell) HTML 8 12-23-2004 11:57 PM
Image Map : alternative text nicole Javascript 0 10-13-2003 12:16 PM



Advertisments