scripting
Baseline 2023Newly available
Since December 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
语法
scripting
功能指定为从下面列表中选择的关键字值。
none
-
脚本在当前文档上完全不可用。
initial-only
-
脚本在最初的页面加载过程中被启用,但在之后则不被启用。
enabled
-
脚本是受支持的并在当前文档上激活。
示例
HTML
html
<p class="script-none">You do not have scripting available. :-(</p>
<p class="script-initial-only">
Your scripting is only enabled during the initial page load. Weird.
</p>
<p class="script-enabled">You have scripting enabled! :-)</p>
CSS
css
p {
color: lightgray;
}
@media (scripting: none) {
.script-none {
color: red;
}
}
@media (scripting: initial-only) {
.script-initial-only {
color: red;
}
}
@media (scripting: enabled) {
.script-enabled {
color: red;
}
}
结果
规范
Specification |
---|
Media Queries Level 5 # scripting |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
scripting media feature |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.