如果在浏览器中禁用Javascript,如何通知 [英] How to inform if Javascript is disabled in the browser

查看:353
本文介绍了如果在浏览器中禁用Javascript,如何通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通知用户是否在浏览器中禁用了javascript并尝试访问我的网站。我的信息如下:请在浏览器中启用javascript以更好地使用网站。那么如何做到这一点?

I want to inform a user if javascript is disabled in the browser and tries to access my website. My information will be like: "Please enable javascript in your browser for better use of the website". So how to do this?

推荐答案

如果要通知用户启用它就是你想做的一切,你不需要依赖于服务器端代码(事实上,我不认为你可以)。只需使用< noscript> 元素:

If informing your users to enable it is all you want to do, you don't need to depend on server-side code (in fact, I don't think you can). Just use a <noscript> element:

<noscript><p>Please enable JavaScript in your browser for better use of the website.</p></noscript>

这篇关于如果在浏览器中禁用Javascript,如何通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆