Thursday, August 2, 2012

HTML noscript tag for javascript disabled browser

We often use javascript for dynamic web site and javascript is getting critical in most web application. So,   we also need to protect from malfunction for browsers that do not support client-side scripts. In this post, I introduce you html <noscript> tag here.
The <noscript> tag is used to provide an alternate content for users that have disabled scripts in their browser or have a browser that doesn’t support client-side scripting.The <noscript> element can contain all the elements that you can find inside the <body> element of a normal HTML page.The content inside the <noscript> element will only be displayed if scripts are not supported, or are disabled in the user’s browser. You can insert <noscript> tag to <head> tag or <body> tag.
Put the following script to <head> tag and disable javascript and then run and see it.
<script type="text/javascript">
        document.write("Hello World!")
</script>
<noscript>
    Please active javascript on your browesr.
</noscript>


No comments:

Post a Comment