How to recognize javaScript is enabled or not in browser?


Hello Developers,

As we all know Javascript is the most popular scripting language for all Web developers. But always there is a question from other end(customers). Question is something like this

If browser does not support JavaScript then what will happen to the JS logic?

Simple answer to this……..the JS logic will never work..:P

But we can think of some alternative like, why not ask the end user to enable the Javascript for your web application. Sounds crazy right!!!

But we have to go in this way. how do you do that?

This solution is simple…just include a HTML tag with few message then you are done. You can see below for example

<noscript> javascript is not enabled on your browser!!!!!!!! </noscript>

This <noscript> tag will do the work for you. As soon as user browses your site with Javascript disabled, this tag will execute and show the particular message. Otherwise this tag will never execute.

You can also try some samples and test in multiple browsers. this should work for you.

Thanks for reading this article.

With Personal Regards

Swagat

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s