Tuesday, 31 July 2012

"< noscript >...< /noscript >" in JAVASCRIPT

It also known as  "Javascript Fallback Content " 

People can turn Javascript off in their browser software which can cause your document to appear broken or incomplete to them if you are using Javascript to render content in any way. There are also situations in which automated software is attempting to index your document's content and it may not be able to process Javascript.
HTML sports a Javascript content fallback feature in which anyone without Javascript enabled will be served up your alternate content, while regular users see the Javascript enabled content. This is done using the <noscript> element of HTML.

If the user has Javascript enabled the <script> element will process while the <noscript> element is completely ignored. If the user does not have Javascript enabled the <script> element gets ignored, and the <noscript> element will process.

Example :

<head runat="server"><title></title><script type="text/javascript">
var myexp = "First Example";</script><script src="Demo.js"></script><noscript>This is no script content</noscript>head>body><form id="form1" runat="server"><div><script type="text/javascript">document.write(myexp);</script><br /><br /><script type="text/javascript">document.write(myExp);</script><noscript>This is no script content</noscript>

No comments:

Post a Comment