• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 312
  • Last Modified:

Identify if user has javascript enabled, if not create a button that would install it

I am building an app that needs the user to have javascript installed and enabled. Can i create a web page that finds out if they have javascript, then if they dont, bring up a page where they can download and install it. I would like this to be internal so no internet is required, therefore for the installation files of javascript to be embedded into my app or the html page.

Can this be done

The html pages are offline ones
1 Solution
If JS is not installed you can't use JS to detect and create a button
nathan1038Author Commented:
What i am looking for is, to find out if js is installed. If not, then like firefox, it tells you, javascript not installed and would you like to install it  - could i do that
You can only tell the user that their browser don't support JavaScript by using the code below. You cannot install JavaScript, as it comes with the browser, which means they have to download and install a modern browser like FireFox.
<noscript>Your browser doesn't support JavaScript! You will need to download and get a modern browser like FireFox!</noscript>

Open in new window

"Can this be done?", no - because you're misinformed about javascript. As sam2912 says, javascript is a core feature of modern browsers.

I wouldn't care to find out how many versions you would have to go back to find browsers without javascript support. However it's long enough to make it safe to assume that your site's visitors will have js capable browsers. The problem will be whether they have it enabled or not.

The <noscript></noscript> tag's purpose is to display the content within when js is disabled or not supported. To enforce js enabled, you can use a meta redirect in noscript tags on your app pages: -

<meta http-equiv="refresh" content="0;URL=please_enable_javascript.html" />

Create a webpage with your 'Please enable javascript.' message and put it's url into the meta tag above. Obviously this code belongs in the <head> of the app documents.

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now