Home > database >  Add a <noscript> tag in Nuxt
Add a <noscript> tag in Nuxt

Time:04-12

I would like to add <body><noscript><h1>Please enable your javascript<h1></noscript></body> in the developer mode.

I tried to configure it in the nuxt.config.js file but it didn't worked.

CodePudding user response:

If you want to setup a noscript tag, you need to create an app.html in the root directory of your project as explained in the documentation.

Like this

<!DOCTYPE html>
<html {{ HTML_ATTRS }}>
  <head {{ HEAD_ATTRS }}>
    {{ HEAD }}
  </head>
  <body {{ BODY_ATTRS }}>
    <noscript>Your browser does not support JavaScript!</noscript>
    {{ APP }}
  </body>
</html>

Keep in mind that if you're using ssr: true, you will still get some content even if the JS is disabled because the content will be generated on the server for some parts.

  • Related