Movatterモバイル変換


[0]ホーム

URL:


  1. 開発者向けのウェブ技術
  2. Web API
  3. Document
  4. implementation

このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docsコミュニティーについてもっと知り、仲間になるにはこちらから。

View in EnglishAlways switch to English

Document: implementation プロパティ

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.

Document.implementation プロパティは、現在の文書に関連付けられたDOMImplementation オブジェクトを返します。

DOMImplementation オブジェクトです。

js
const modName = "HTML";const modVer = "2.0";const conformTest = document.implementation.hasFeature(modName, modVer);console.log(`DOM ${modName} ${modVer} supported?: ${conformTest}`);// ログ: "DOM HTML 2.0 supported?: true" (hasFeature は常に true を返す)

警告:これを昨日検出に使用しないでください。hasFeature() メソッドは常に true を返します。

メモ

W3C's DOM Level 1 勧告ではhasFeature メソッドのみが定義されているので、ブラウザーが DOM モジュールに対応しているかどうかを判断する方法の一つです。 (上記の例とWhat does your user agent claim to support? を参照してください)。利用できるのであれば、DOMImplementation の他のメソッドが、単一文書の外のものを制御するサービスを提供します。例えば、DOMImplementation インターフェイスはcreateDocumentType メソッドを含んでおり、実装によって管理された 1 つ以上の文書に DTD が作成されます。

仕様書

Specification
DOM
# ref-for-dom-document-implementation①

ブラウザーの互換性

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp