I would propose that the <noscript> tag has an optional "type" element, which, if specified, would cause the <noscript> tag to be ignored only if the user agent supports and is configured to run scripts of the type requested.
For example, a code block beginning <noscript type="text/javascript"> would only be displayed if the user agent did not support JavaScript, or JavaScript was turned off. The browser would still, potentially, execute other script types.
The ultimate aim of this would be to provide future-proof web applications as (and if) new scripting languages become available, by providing less-ideal fallback languages during the migration period. For example, if a new scripting language (represented here by a fictional language served as type "text/supernewlanguage"), both effecient new supernewlanguage and fallback retro javascript support could be provided with the following code:
- Code: Select all
<script type="text/supernewlanguage">
// supernewlanguage is supported
superNewLanguageCode();
</script>
<noscript type="text/supernewlanguage">
<!-- supernewlanguage is not supported -->
<script type="text/javascript">
// javascript alternative
javascript_alternative();
more_code_for_js_alternative();
</script>
<noscript type="text/javascript">
<!-- javascript isn't supported either -->
<p>
I'm sorry, but javascript support (or, better yet, super
new language support) is required to use this web
application.
</p>
</noscript>
</noscript>
This could, of course, be extended as deep as is necessary. This provides the capability for sites to be backwards compatible as new languages are made available.
Unfortunately, such a change would require several changes to the specification, including the permitting of embedding <noscript> tags.