- From: Philippe Le Hegaret <plh@w3.org>
- Date: Wed, 14 Mar 2012 10:02:11 -0400
- To: Cameron McCormack <cam@mcc.id.au>
- Cc: spec-prod <spec-prod@w3.org>
On Wed, 2012-03-14 at 11:37 +1100, Cameron McCormack wrote:
> Do you have a concrete suggestion on how to implement this fallback? I
> cannot think right now of a way to do this without script, for example:
>
> <!DOCTYPE html>
> <style>
> body.no-inline-svg svg,
> .svg-fallback { display: none }
> body.no-inline-svg .svg-fallback { display: initial }
> </style>
> <body>
> <svg></svg>
> <script>
> var e = document.getElementsByTagName("svg")[0];
> if (e.namespaceURI != "http://www.w3.org/2000/svg") {
> document.body.className = "no-inline-svg";
> }
> e.parentNode.removeChild(svg);
> </script>
> <p>Consider the following diagram:</p>
> <svg>
> <path d="..."/>
> </svg>
> <img class=svg-fallback src=diagram.png>
That would work for me at least. It guarantees that you'll see something
independently of whether scripting is enabled or not.
Philippe
Received on Wednesday, 14 March 2012 14:02:25 UTC