implementation object
Contains information about the features supported by the browser and provides methods for creating base objects.
Syntax:
Properties that reference the object:
| object.implementation |
Related objects:
|
The base interface, through which you can add new functionalities to the implementation object, is the DOMImplementation interface.
Possible members:
Methods:
createDocument |
|
Creates an XML document object. | ||||||||||
createDocumentType |
|
Creates a new doctype object. | ||||||||||
hasFeature | Returns whether the specified feature and version is implemented by the browser. |
Example HTML code 1:
This example illustrates the use of the implementation object and the hasFeature method:
|
||||
<head> <script type="text/javascript"> function CheckFeature () { alert (document.implementation.hasFeature ("HTML","1.0")); } </script> </head> <body> <button onclick="CheckFeature ()">Is the DOM HTML 1.0 standard is implemented?</button> </body> |
||||
|
||||
Did you find this example helpful?
|
Example HTML code 2:
This example illustrates the use of the implementation object and the createDocument and createDocumentType methods:
|
||||
<head> <script type="text/javascript"> function CreateXMLDoc () { if (document.implementation.createDocument && document.implementation.createDocumentType) { var fruitDocType = document.implementation.createDocumentType ("fruit", "SYSTEM", "<!ENTITY tf 'tropical fruit'>"); var xmlDoc = document.implementation.createDocument ("", "fruits", fruitDocType); var fruitNode = xmlDoc.createElement ("fruit"); fruitNode.setAttribute ("name" , "avocado"); xmlDoc.documentElement.appendChild (fruitNode); var serializer = new XMLSerializer(); alert (serializer.serializeToString (xmlDoc)); } else { alert ("Your browser does not support this example"); } } </script> </head> <body> <button onclick="CreateXMLDoc ();">Create an XML document with document type!</button> </body> |
||||
|
||||
Did you find this example helpful?
|
External links:
implementation object (MSDN)
implementation property (MSDN)
implementation (Mozilla Developer Center)
implementation object (W3C)
implementation property (W3C)
implementation property (MSDN)
implementation (Mozilla Developer Center)
implementation object (W3C)
implementation property (W3C)
User Contributed Comments