DEV Community

Cover image for Enable a better experience with noscript HTML element!
Jordan Finneran
Jordan Finneran

Posted on • Edited on • Originally published at jordanfinners.dev

2

Enable a better experience with noscript HTML element!

Contents

  1. Intro
  2. noscript
  3. Example
  4. Summary

Intro

If you run your website with Scripting turned off (JavaScript disabled for example), what do you get? I'd be really interested to see screenshots in comments.

If your site relies upon JavaScript you might not get anything. Now there is a really nice element to provide a better experience to your users if this is the case - introducing noscript

noscript

You can provide those users without scripting a better experience and include custom messaging for them using the noscript element.
This will only be displayed when a script type is unsupported on the page or scripting is turned off.

Example

Shut up and show me the code.

<noscript>
    <p>JavaScript is required to run this page, please enable it by doing X, Y, Z.</p>
</noscript>
Enter fullscreen mode Exit fullscreen mode

Summary

In summary, you can use what browsers give you to create a better experience for those users without scripting!
Even if it is to tell them what to do, to get the real experience.

Element reference can be found here.

Happy building!

Let me know what your sites look like without scripting on!

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more