alternative image ??

Discussion in 'HTML' started by Sid, Apr 27, 2005.

  1. Sid

    Sid Guest

    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).
     
    Sid, Apr 27, 2005
    #1
    1. Advertising

  2. Sid

    SpaceGirl Guest

    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.
     
    SpaceGirl, Apr 27, 2005
    #2
    1. Advertising

  3. 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/buy-opera.html?AID=882173
     
    Lauri Raittila, Apr 27, 2005
    #3
  4. Sid

    Spartanicus Guest

    "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
     
    Spartanicus, Apr 27, 2005
    #4
  5. Sid

    Nik Coughin Guest

    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.
     
    Nik Coughin, May 3, 2005
    #5
  6. Sid

    Spartanicus Guest

    "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
     
    Spartanicus, May 3, 2005
    #6
  7. 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=-
     
    Travis Newbury, May 3, 2005
    #7
  8. 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.
     
    Leif K-Brooks, May 3, 2005
    #8
  9. 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=-
     
    Travis Newbury, May 3, 2005
    #9
  10. Sid

    Nik Coughin Guest

    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.
     
    Nik Coughin, May 5, 2005
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. (Pete Cresswell)
    Replies:
    8
    Views:
    484
    Duende
    Dec 23, 2004
  2. Laszlo Zsolt Nagy
    Replies:
    1
    Views:
    1,433
    Kartic
    Jan 26, 2005
  3. Åukasz M.
    Replies:
    0
    Views:
    407
    Åukasz M.
    May 13, 2010
  4. nicole

    Image Map : alternative text

    nicole, Oct 13, 2003, in forum: Javascript
    Replies:
    0
    Views:
    83
    nicole
    Oct 13, 2003
  5. joe

    Alternative Image

    joe, May 17, 2005, in forum: Javascript
    Replies:
    4
    Views:
    98
    Thomas 'PointedEars' Lahn
    May 25, 2005
Loading...

Share This Page