javascript Noscript 重定向(我需要重定向)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18810369/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Noscript to redirect (I need to redirect)
提问by KriiV
I want to disallow access to my website when the user does not have Javascript. I do not with to simply display a message. How would I go about doing this? None of the other questions are quite the same in the sense of disallowing access.
当用户没有 Javascript 时,我想禁止访问我的网站。我不只是简单地显示一条消息。我该怎么做呢?在不允许访问的意义上,其他问题都不完全相同。
Something like this:
像这样的东西:
<noscript>
Redirect to another page.
</noscript>
But I've seen that this is not good to do? I repeat though, I do not simply want to display a message.
但是我见过这样不好做吗?我再说一遍,我不只是想显示一条消息。
Thanks.
谢谢。
回答by Rahul Tripathi
You may try this:-
你可以试试这个:-
<noscript>
<a href="">Click here to continue</a>
</noscript>
or
或者
<noscript>
<meta http-equiv="refresh" content="0;url=noscript.html">
</noscript>
回答by David-SkyMesh
- Have your landing page be your NON-JavaScript warning page.
- Include a peice of JavaScript called from
onload
to re-direct to your REAL page (where you assume the end-user has JavaScript).
- 让你的登陆页面成为你的非 JavaScript 警告页面。
- 包含一段调用 from 的 JavaScript 以重定向
onload
到您的真实页面(您假设最终用户拥有 JavaScript)。
回答by Shane A. Darr
Here is an solution from another post.
<meta http-equiv="refresh" content="0; url=http://example.com/">
这是另一个帖子的解决方案。
<meta http-equiv="refresh" content="0; url=http://example.com/">