By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
463,152 Members | 647 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 463,152 IT Pros & Developers. It's quick & easy.

<noscript> not working

P: 69
Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="C#" %>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
  4. <script language="JavaScript" type="text/javascript">
  6. </script>
  7. <noscript>
  8.      <b>Please</b> Try this page for browsers that can not handle SCRIPTing.
  9.      <a href="EnableJavascript.aspx">click here</a>
  10. </noscript>
  12. <html xmlns="" >
  13. <head runat="server">
  14.     <title>Untitled Page</title>
  16. </head>
  17. <body>
  18.     <form id="form1" runat="server">
  19.     <div>
  20.      hello there
  21.     </div>
  22.     </form>
  23. </body>
  24. </html>
Can someone tell me why the above code is not working.
i am trying to test the <noscript> tag.
I am only seeing hello There, but i am supposed to also see the link click here.

I disabled scripting in the browser

please help
Jun 4 '08 #1
Share this Question
Share on Google+
4 Replies

Expert Mod 15k+
P: 16,027
The <noscript> tag should be in the body.

PS. moved to the HTML/CSS forum.
Jun 4 '08 #2

P: 69

Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="C#"  %>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
  3. <html xmlns="" >
  5. <body>
  7. <noscript>No JavaScript support!</noscript>
  9. <p>A browser that does not support JavaScript will show the text in the noscript element.</p>
  11. </body>
  13. </html>
i did the above code and it works as a stand alone page. however, my site uses masterpages so i dont know how to incorporate the <noscript> tag into my site since the <body> tag is in teh ,masterpage

any suggestions
Jun 4 '08 #3

Expert Mod 15k+
P: 16,027
That would be a .NET problem. I don't see why it can't be added to the content page. If that doesn't solve it, ask in the .NET forum.
Jun 4 '08 #4

P: 111
in which case, rather than use the noscript tag.

put the message in a div, and make the div always visable.

If you have a generic master footer template for your webpages.
You can then use javascript to hide this div. If the user has no javascript then the javascript code will not execute and therefore, will not hide the div containing your message.
Jun 6 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.