Hey all! Pretty simple I hope :D I have a website that absolutely requires JavaScript to be enabled for it to work. How can I make it so that if a user with JavaScript disabled tries to view my site they are redirected to an error message? Thanks!

Recommended Answers

All 4 Replies

<noscript>This page requires javascript</noscript> anything between noscript tags is ignored if javascript is active, and the tags are ignored and the contents parsed if javascript is inactive
Any contents

Thanks! How can I make the entire page just not load if JavaScript is not enabled? I want a non-JavaScript user redirected to a separate page. Thanks a ton!

put the <noscript> in the <head>
put a html redirect in the noscript

<head>
<noscript>
<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.yourdomain.com/noscriptpage.html"> 
</noscript>
<!-- rest of file-->

Thanks a bunch! Have a wonderful day!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.