Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7885269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:01:05+00:00 2026-06-03T05:01:05+00:00

I want to check if Javascript enabled or not. If its enabled then it

  • 0

I want to check if Javascript enabled or not.
If its enabled then it show the rest of code but if it’s disabled it will redirect to google.com

Now, how to do that? I’m trying to write this code:

<script type="text/javascript">
document.write("Hello World!")
</script>
<noscript>Your browser does not support JavaScript!
<p>JS must be enabled</p>
<META HTTP-EQUIV=Refresh CONTENT="3; URL='www.google.com'">
</noscript>
<p>this code must be hidden when JS is disabled</p>

but the result is:

Your browser does not support JavaScript!
JS must be enabled
this code must be hidden when JS is disabled

and what I want to is the code outside the noscript won’t run if there’s no JS enabled
so, at the example it would like this:

Your browser does not support JavaScript!
JS must be enabled
(go to google)

Info: I’m using PHP

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T05:01:06+00:00Added an answer on June 3, 2026 at 5:01 am

    I think your code is correct
    please change

    <META HTTP-EQUIV=Refresh CONTENT="3; URL='www.google.com'">
    this to
    <META HTTP-EQUIV=Refresh CONTENT="3; URL='http://www.google.com'">
    

    use http://

    and for content hiding use a class for body and set its property to display none, and use a jquery function to add display block to show the content, the jquery function only works if javascript is enabled. so the content is disabled for javascript disabled mode.

    eg.,

    <style>
    .test
    {
      display:none;
    }
    </style>
    <script>
    $(document).ready(function(){
        $(".test").show();
    });
    </script>
    <p class="test">The section should hidden for javascript disabled mode</p>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In javascript I check for some characters but I want to allow underscores and
I want to check if a mobile browser has javascript enabled before displaying a
I want to check if a particular page gets redirected or not. However, whenever
I want to check some javascript statements behavior quickly. Is there any build-in tool
I want to use javascript to check if a class exists within a UIWebView.
Possible Duplicate: Check if JavaScript is enabled with PHP Is there some way to
How to check if the user disabled javascript in his browser? For example: the
Possible Duplicate: javascript domready? I want to check whether $(function(){ }); is ready. Return
Probably a duplicate of this question . Silly javascript question: I want to check
I use Google Analytics, and the first thing I want to check every day

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.