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

<noscript> not working

P: 69
Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="C#" %>
  2.  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <script language="JavaScript" type="text/javascript">
  5.  
  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>
  11.  
  12. <html xmlns="http://www.w3.org/1999/xhtml" >
  13. <head runat="server">
  14.     <title>Untitled Page</title>
  15.  
  16. </head>
  17. <body>
  18.     <form id="form1" runat="server">
  19.     <div>
  20.      hello there
  21.     </div>
  22.     </form>
  23. </body>
  24. </html>
  25.  
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


acoder
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
thanks

Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="C#"  %>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" >
  4.  
  5. <body>
  6.  
  7. <noscript>No JavaScript support!</noscript>
  8.  
  9. <p>A browser that does not support JavaScript will show the text in the noscript element.</p>
  10.  
  11. </body>
  12.  
  13. </html>
  14.  
  15.  
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

acoder
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

100+
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.