Prompt Active Scripting disabled message

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mukeshrasm
    Contributor
    • Nov 2007
    • 254

    Prompt Active Scripting disabled message

    Hi

    I have developed website using php and mysql and in that I have used JavaScript as well. I tried to run this website on different computer and set its browser's Active Scripting disabled. so javascript is not working on that system. Now what i wanted that if user's javascript/active scripting is disbaled then it should prompt user to enable it or it enable automatically. How can i do this?
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    you can’t enable it automatically, but you can leave a note either using <noscript> or any element that you remove via javascript.

    Comment

    • mukeshrasm
      Contributor
      • Nov 2007
      • 254

      #3
      Originally posted by Dormilich
      you can’t enable it automatically, but you can leave a note either using <noscript> or any element that you remove via javascript.
      How mean what will be the exact code to do it

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        Originally posted by mukeshrasm
        How mean
        indeed, if I want JavaScript off, no-one but me is allowed to turn it back on.

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          LOL, I don't think that was what he meant!

          mukeshrasm, have you tried looking at the use of the noscript tag?

          Comment

          • mukeshrasm
            Contributor
            • Nov 2007
            • 254

            #6
            Originally posted by acoder
            LOL, I don't think that was what he meant!

            mukeshrasm, have you tried looking at the use of the noscript tag?
            Hi Yes I am looking the use of noscript tag and how can I prompt user to enable Active Scripting if it is disabled

            Comment

            • Dormilich
              Recognized Expert Expert
              • Aug 2008
              • 8694

              #7
              Originally posted by mukeshrasm
              how can I prompt user to enable Active Scripting if it is disabled
              see post #2.

              prompt() is a JavaScript method, i.e. it only works with JavaScript enabled.

              Comment

              • acoder
                Recognized Expert MVP
                • Nov 2006
                • 16032

                #8
                If by prompt, you simply mean a message to be displayed, the <noscript> tag is perfect for that task:
                Code:
                <noscript>You can browse this site without having JavaScript enabled, but to experience the full benefits of the site, please enable JavaScript.</noscript>

                Comment

                • Dormilich
                  Recognized Expert Expert
                  • Aug 2008
                  • 8694

                  #9
                  for the standardista among us:
                  <noscript> requires to have only block level elements as content (children)
                  Code:
                  <noscript>
                      <p>your message</p>
                  </noscript>

                  Comment

                  • acoder
                    Recognized Expert MVP
                    • Nov 2006
                    • 16032

                    #10
                    Thanks, I was going to put the <p> tag in, but forgot.

                    Comment

                    • Dormilich
                      Recognized Expert Expert
                      • Aug 2008
                      • 8694

                      #11
                      the browser wouldn’t have cared anyway, until you ask it to use the XHTML parser.

                      Comment

                      Working...