Chapter 5
support canvas will show the inner content just as if the outer canvas element didn’t exist. The fallback
content should preferably be some usable replacement content, such as an image or text equivalent,
depending on what you’re drawing. For example, if you’re using canvas to render charts from numerical
data, the fallback content might be the same data presented in a table. If it’s a diagram or illustration, you
could provide a static image version of it, like you see in Listing 5-10 (Figure 5-11 shows the result). If the
canvas drawing is decorative and not essential, leaving the element empty means older browsers won’t
display anything at all.
Listing 5-10. A canvas element containing an image as fallback content for older browsers
Figure 5-11. Older browsers that don’t support canvas will show the static image instead