[whatwg] whatwg Digest, Vol 94, Issue 45

Charles Pritchard chuck at jumis.com
Wed Jan 25 12:36:19 PST 2012


On 1/25/12 12:08 PM, whatwg-request at lists.whatwg.org wrote:
> 2. We can add the script polyfil in seamlessly - conforming UA's will
> ignore internal content, non-conforming UA's will treat it as an
> element they should descend into and thus load the required script.
> <intent ...>
>    <!-- Load the polyfill shim -->
>    <script src="http://webintents.org/webintents.min.js"></script>
> </intent>

I don't think you can use the fallback content as a method of optionally 
loading the script tag.

The resource is loaded as part of the DOM, the only way to get around 
that is with <noscript>, which would get awkward.

I learned this while exploring <img> content in fallback tags:
<canvas><img src="loaded.png" title="this image tag will always be 
loaded" /></canvas>.

This is more typical:
if(!self.Intent) 
document.head.appendChild(document.createElement('script')).src='shimaddress.js';


-Charles



More information about the whatwg mailing list