我有一个 Rails 网络应用程序(在线考试系统)。我在考试界面中使用 JavaScript 禁用了右键单击、选择、复制等。所以,我希望我的应用程序检测是否在界面启动时启用了 JavaScript。我已经通过使用<noscript>
标签检查了它,如下所示。
<noscript>
<meta http-equiv="refresh" content="5">
<div id="noscript_message" style="color: white; background-color: red;">
It is detected that Javascript is turned off in your web brower. Please turn it on to load the page correctly. For more reference about how to turn it on, please refer <a href="http://www.enable-javascript.com/" target="_blank">
instructions how to enable JavaScript in your web browser</a>.
</div>
</noscript>
但我只能检测并显示一条消息作为警告。我的意图不是加载该页面并仅显示警告消息。怎样才能做到这一点?
谢谢 :)-