/    Sign up×
Community /Pin to ProfileBookmark

ERROR: JavaScript disabled.

Does anybody know how to direct a user to an error page if javascript on his/her browser is disabled?

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@KravvitzNov 15.2005 — You can use the <noscript> element to display a link for people who are using a browser that does not have JavaScript enabled to follow.
Copy linkTweet thisAlerts:
@thisObjectauthorNov 16.2005 — cool, thanks,

Here is what I found:
<i>
</i>&lt;noscript&gt;
&lt;meta http-equiv="refresh" content="2; URL=../../dummy.html"&gt;
&lt;/noscript&gt;


This would redirect to another page BUT initial page still visible for a second or two until redirect is done.

Is there away to completely restrict a user to see the page he/she is not supposed to see if JS is disabled?
Copy linkTweet thisAlerts:
@KravvitzNov 16.2005 — Not really.

You could change the 2 to a 0.

You should provide a clickable link as well, since there might be some browsers that don't have meta refreshes enabled.
Copy linkTweet thisAlerts:
@thisObjectauthorNov 16.2005 — thanks, so if there is a browser that does not have meta refreshes enabled than the user will see JS-enabled page?

I do not want the user to see JS-enabled page at all. Is there a good solution for this?

thanks
Copy linkTweet thisAlerts:
@KravvitzNov 16.2005 — There's not much else you can do except forward people to the JS-enabled page from the JS-disabled page.
Copy linkTweet thisAlerts:
@felgallNov 16.2005 — You can set up a link so that it directs to one page if Javascript is enabled and to a different page if it is disabled.

<a href="disabled.htm" onclick="self.location='enabled.htm';return false'">next page</a>
×

Success!

Help @thisObject spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...