Display Alert in Google Chrome when javascript is disabled.

Posted by Naveenrohillamca under .NET Framework on 12/18/2014 | Points: 10 | Views : 517 | Status : [Member] | Replies : 2
Hello Sir/Madam,

I want to display alert on different browser while javascript is disabled.
Is there any headway to display alert.

Thanks
in Advance




Responses

Posted by: kgovindarao523-21772 on: 12/18/2014 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Hi,
Here is the code to check Javascript availability.
<noscript>
alert('Java script has been disabled in this browser')
</noscript>

Thank you,
Govind

Naveenrohillamca, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sheonarayan on: 12/18/2014 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
You are fast Govindarao..... I was about to answer and found you did it first!. Congratulations !!!

<noscript>
<style type="text/css">
.alertClass{display:none;}
</style>
<div class="alertClass">
Sorry, JavaScript is disabled. Please enable to get the best out of the website.
</div>
</noscript>

You can write message in <noscript> </noscript>. Above code will only run when JavaScript is enabled and in that case it will hide the div message, otherwise it will show the div message.

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Naveenrohillamca, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response