admin管理员组文章数量:1401171
in browser , there is options that web site users can disable scripts that consequently this may be disable masks and other codes write with jquery and another scripts , and there for web site will have exception or may be web site hack. how to safe web site with these options? thanks
in browser , there is options that web site users can disable scripts that consequently this may be disable masks and other codes write with jquery and another scripts , and there for web site will have exception or may be web site hack. how to safe web site with these options? thanks
Share Improve this question edited Sep 4, 2012 at 7:11 Danil Speransky 30.5k6 gold badges69 silver badges78 bronze badges asked Aug 19, 2012 at 14:34 Yasmine WeberYasmine Weber 11 silver badge1 bronze badge 1- 1 You ought to save your website with checking any user's actions on the back-end side – khomyakoshka Commented Aug 19, 2012 at 14:43
2 Answers
Reset to default 4You (luckily) cannot control what the user does with his user-agent (if I understood your question that is).
The only thing you can do is show a message that the website doesn't work with javascript disabled.
You can't stop users from disabling javascript if they don't want to turn it on.
Your only recourse is to require javascript before allowing them to use your website.
This can be done by wrapping everything in a "display: none", eg.
<div id="content" style="display: none">
PAGE CONTENT HERE
</div>
And a message:
<div id="javascriptrequired">You need javascript to use this website.</div>
And then use javascript to set the display back on, and turn the message off:
<script>
$("#content").css("display: block;"); // assuming you have jquery
$("#javascriptrequired").css("display: none;"); // turn javascript message off
</script>
本文标签: javascripthow to prevent users to disable scripts with browser optionsStack Overflow
版权声明:本文标题:javascript - how to prevent users to disable scripts with browser options - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744225614a2596073.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论