How to determine if JavaScript is disabled using Meteor.com

When using Meteor.com, does anyone know how to determine if the JavaScript JavaScript of the browser is disabled ...

And show the message to the end user in the browser window, that is, "Enable JavaScript."

+4
source share
3 answers

I assume that you have layout.htmlor at least a main.htmlcontaining at least <head>.

The trick is placing <noscript>in <head>instead <body>.

Meteor does not display everything in JS. There are some things that appear on the start page, proof of which can be seen in View Source ( CTRL+ U).

+3

Meteor Chrome, . :

<head>
    <noscript>Please enable JavaScript.</noscript>
</head>

<template name="index">
...
</template>
+1

I just used it and it really worked like a charm

<head>
<noscript>
<style>
body {font-size: 32px;text-align: center;line-height: 100vh;}
body:after {content: "Please enable JavaScript";}
</style>
</noscript>
</head>
+1
source

All Articles