Social Question

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?

Observing members: 0 Composing members: 0

3 Answers

pjanaway's avatar

I don’t understand how it wouldn’t be available in the first place. Unless your storing the css on a different server?

will's avatar

There are other failover situations I am considering as well for a software system I’m working on. Even if this reason for doing it isn’t a good one, there are others.

pjanaway's avatar

As for your jQuery question you can use it to check if a file exists.

Answer this question

Login

or

Join

to answer.
Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther