Send to a Friend

will's avatar

What is the easiest way to get link failover in XHTML?

Asked by will (104points) December 8th, 2009

In XHTML, if you nest <object> tags, they failover. I.e. if you have:

<object data=“cat.jpg”>
<object data=“dog.jpg”/>
</object>

dog.jpg will be displayed only if cat.jpg can’t be displayed (for any reasons from a 404 to lacking the right plugin).

I would like something similar for the <link> tags used to connect stylesheets. Something like:

<link rel=“stylesheet” type=“text/css” href=“doh.css”>
<link rel=“stylesheet” type=“text/css” href=“http://dhappy.org/doh.css”>
</link>

and the browser only downloads from the internet if the local copy isn’t available. (Or failover for any other reason.) This doesn’t exist though, right?

It’d probably be easiest to do it in what? jQuery?

Using Fluther

or

Using Email

Separate multiple emails with commas.
We’ll only use these emails for this message.