【发布时间】:2011-08-06 11:46:48
【问题描述】:
这在所有浏览器中都安全吗?这是一种在 js 关闭时简单地将用户重定向到不同位置的方法。
<noscript>
<meta http-equiv="refresh" content="0;url=http://site.com/nojs">
</noscript
【问题讨论】:
标签: javascript graceful-degradation
这在所有浏览器中都安全吗?这是一种在 js 关闭时简单地将用户重定向到不同位置的方法。
<noscript>
<meta http-equiv="refresh" content="0;url=http://site.com/nojs">
</noscript
【问题讨论】:
标签: javascript graceful-degradation
我更喜欢将no-js 类添加到<html> 元素。您可以将此技巧与ie-x 类结合使用。
例如:
<!doctype html>
<!--[if lt IE 7]> <html class="no-js ie6" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<!-- some meta tags --->
<script>
(function(doc) {
doc.className = doc.className.replace(/(^|\b)no\-js(\b|$)/, 'js');
}(document.documentElement));
</script>
<!-- other script tags should be before </body> -->
您可以在此处阅读:html5boilerplate 和 here
【讨论】: