Document:fragmentDirective 属性
Baseline 2024Newly available
Since October 2024, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
Document
接口的 fragmentDirective
只读属性返回当前文档的 FragmentDirective
。
值
示例
在支持该特性的浏览器中打开一个包含一个或多个匹配的文本片段的标签页,并尝试在其开发者工具中运行以下代码:
js
document.fragmentDirective;
// 如果支持则返回空的 FragmentDirective 对象,否则返回 undefined
此功能目前主要用于特性检测。未来 FragmentDirective
对象可以包含更多信息。
规范
Specification |
---|
URL Fragment Text Directives # dom-document-fragmentdirective |