Anne van Kesteren

Fallback

This will eventually be in some standard, like HTML5. The information provided here is of course non-normative. However, it might help you choose a particular element for referencing other documents. Enough blah, here we go.

There is a distinction between element fallback and content fallback. It might be worth explaining what fallback is before we get to that. Fallback is shown whenever something is not supported, turned off or not available for other reasons. For example, when browsers do not render the image referenced by the img element because it was not a valid image, it returned a 404, images were turned off by the user they instead render the text from the alt attribute. This would fit perfectly in the content fallback category. More on that later.

Element fallback is shown only when the element of which it is the fallback is not supported or disabled. This applies to the iframe element for example. No matter what you try to load in it, as long as your browser supports it it will be shown. It acts as a browser window within a browser window. When the server returns an error it will be rendered within the iframe. Content fallback applies when the fallback is shown when the content that is being loaded through an element is corrupted, disabled or simply not available; for example, it returns an HTTP status code that indicates a problem, like 410 et cetera. An example of an element that does content fallback would be the object element. Indeed, very useful and not really supported.