<noscript> not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • phpmel
    New Member
    • Oct 2007
    • 69

    <noscript> not working

    Code:
    <%@ Page Language="C#" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <script language="JavaScript" type="text/javascript">
         
    </script>
    <noscript>
         <b>Please</b> Try this page for browsers that can not handle SCRIPTing.
         <a href="EnableJavascript.aspx">click here</a>
    </noscript>
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Untitled Page</title>
        
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
         hello there
        </div>
        </form>
    </body>
    </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
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    The <noscript> tag should be in the body.

    PS. moved to the HTML/CSS forum.

    Comment

    • phpmel
      New Member
      • Oct 2007
      • 69

      #3
      thanks

      Code:
      <%@ Page Language="C#"  %>
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml" >
      
      <body>
      
      <noscript>No JavaScript support!</noscript>
      
      <p>A browser that does not support JavaScript will show the text in the noscript element.</p>
       
      </body>
      
      </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

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        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.

        Comment

        • nitinpatel1117
          New Member
          • Jun 2007
          • 111

          #5
          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.

          Comment

          Working...