Java OpenResty Spring Spring Boot MySQL Redis MongoDB PostgreSQL Linux Android Nginx 面试 小程序 Arthas JVM AQS juc Kubernetes Docker 诊断工具


HTML 判断是否禁用了 JS

HTML JavaScript 大约 707 字

noscript

<head></head>中使用自带<noscript></noscript>标签,可有浏览器识别。如果禁用了JS则执行noscript中代码。

示例

添加页面标签元素提示

<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <noscript>
        <div>
            你禁止了JS
        </div>
    </noscript>
</head>
<body>

This is content

</body>
</html>

重定向到指定页面提示

<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

    <noscript><meta http-equiv="refresh" content="0; url=https://www.baidu.com" /></noscript>
</head>
<body>

This is content

</body>
</html>
阅读 2262 · 发布于 2020-11-27

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb

扫描下方二维码关注公众号和小程序↓↓↓

扫描二维码关注我
昵称:
随便看看 换一批