/    Sign up×
Community /Pin to ProfileBookmark

Can you detect if a browser supports javascript or not?

Hi,
I am developing an application for mobile browsers some of which support javascript and some dont. So i want to notify the user if his/her browser does not suppoert java script is this possible in any way?. Basically i dont want the user to use my application if his browser doesnt support java script.
Thank you in advance

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@David_HarrisonOct 13.2005 — Why not? What is it neccessary to turn people away simply because JavaScript is not supported?

Why can't you serve up an HTML and CSS version that doesn't rely on JavaScript? There's nothing wrong with using JavaScript to enhance something, but to rely on it so that it fails for those without JavaScript, that's when something is wrong.

However, you could simply redirect JavaScript users to a different page:location.replace("http://www.w3.org/");
Copy linkTweet thisAlerts:
@aditya_internetOct 19.2005 — Hi,

May b this will not help u, as you want that user sud not b able to use ur app if he dont hav javascript but if u ever want to display just a message to the user that they cant run javascript on there browser, use this.

[code=html]
<noscript>
Your browser does not support Javascript or it is disabled, try to enable it.
</noscript>
[/code]
Copy linkTweet thisAlerts:
@David_HarrisonOct 19.2005 — Some people can't enable JavaScript, and some don't want to.
Copy linkTweet thisAlerts:
@JPnycOct 20.2005 — There's a simple way to do this. The initial contact page contains a JS redirect to the main page. If they don't have JS, it'll never get there.
Copy linkTweet thisAlerts:
@aditya_internetOct 20.2005 — Hi,

If you want to restrict people from accessing your page without javascript then anyone can just view the source of your contact page and see the url it is redirecting to and directly access the page.
×

Success!

Help @m_kk 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.19,
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,
)...