この文書は翻訳中です。他国語のままの部分などがあるのはその為です。
是非お気軽に MDN に登録して翻訳に参加し、私たちの手助けをして下さい!
概要
現在のドキュメントに関連付けられた DOMImplementation オブジェクトを返します。
構文
DOMImpObj = document.implementation;
例
var modName = "HTML"; var modVer = "2.0"; var conformTest = document.implementation.hasFeature( modName, modVer ); alert( "DOM " + modName + " " + modVer + " supported?: " + conformTest ); // DOM Level 2 HTML module がサポートされている場合、"DOM HTML 2.0 supported?: true" とアラート表示されます。
モジュール名 (※ Core 、HTML 、XML 等) の一覧は Conformance Section で入手可能です。
注記
W3C's DOM Level 1 勧告では、DOM モジュールがブラウザでサポートされているかどうかを判断する方法のひとつとして hasFeature メソッドが定められています(上記の例と What does your user agent claim to support? を参照して下さい)。 If available, other DOMImplementation methods provide services for controlling things outside of a single document. For example, the DOMImplementation interface includes a createDocumentType method with which DTDs can be created for one or more documents managed by the implementation.
メソッド
| 名称 | 動作 | 戻り値 |
|---|---|---|
createDocument (namespaceURI, qualifiedNameStr, DocumentType ) |
document |
|
createDocumentType ( qualifiedNameStr, publicId, systemId ) |
DocumentType |
|
createHTMLDocument ( title ) |
document |
|
getFeature ( feature, version ) |
DOMObject |
|
hasFeature ( feature, version ) |
Boolean |