W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2006

[whatwg] Inline SVG

From: Alexey Feldgendler <alexey@feldgendler.ru>
Date: Sat, 09 Dec 2006 23:35:19 +0600
Message-ID: <op.tkay45061h6og4@localhost>
On Sat, 09 Dec 2006 19:54:29 +0600, Michel Fortin  
<michel.fortin at michelf.com> wrote:

> You'd need a JavaScript fallback in addition to noscript, something like  
> this:
>
> <script type="text/xml" id="a">
>    <xml-element/>
> </script>
> <noscript id="b">
>    fallback content
> </noscript>
> <script type="text/javascript">
>    if (/* browser does not support XML scripts */) {
>      if (/* has some javascript XML parser library */) {
>        parserLibrary.parseAndInsertXML(getElementById("a").textContent);
>      } else {
>        document.write(getElementById("b").textContent);
>      }
>    }
> </script>
>
> It could also be an external script that justs search the document for a  
> particular class of <noscript> element once the document is loaded.

I'm afraid that <noscript> doesn't end up in DOM when scripting is enabled.


-- 
Alexey Feldgendler <alexey at feldgendler.ru>
[ICQ: 115226275] http://feldgendler.livejournal.com
Received on Saturday, 9 December 2006 09:35:19 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:31 UTC