Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

compatible property

[This documentation is preliminary and is subject to change.]

Retrieves the collection of user agents and versions declared in the X-UA-Compatible meta tag.

Internet Explorer 8

Syntax

HRESULT value = object.get_compatible(IHTMLDocumentCompatibleInfoCollection** p);

Property values

Type: Object

the collection of user agents and versions.

Remarks

This method is available in all compatibility modes.

Examples

The following script iterates through the collection of compatible user agents, and displays each on a separate line.


<meta http-equiv="X-UA-Compatible" content="IE=8;FF=3;OtherUA=4" />
				
<script type="text/javascript">
window.attachEvent('onload',function(e) {
    var a = [];
    var compat = document.compatible;
    for (var i=0; i<compat.length; i++) {
        a.push(compat[i].userAgent + '=' + compat[i].version);
    }
    var o = document.getElementById('output');
    o.innerHTML = a.join('<br/>');
});
</script>

<div id="output"></div> 

See also

Reference
IHTMLDocument5::compatMode
Conceptual
Defining Document Compatibility

 

 

Build date: 6/6/2012

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft. All rights reserved.