IHTMLMetaElement::content Property

Gets or sets meta-information to associate with IHTMLMetaElement::httpEquiv or IHTMLMetaElement::name.

Syntax

HRESULT IHTMLMetaElement::get_content(BSTR *p);
HRESULT IHTMLMetaElement::put_content(BSTR v);

Parameters

  • p
    Pointer to a variable of type BSTR that receives one of the values listed in Possible Values.
  • v
    BSTR that specifies one of the values listed in Possible Values.

Possible Values

description Meta-information.
refresh Integer consisting of the number of seconds to elapse before the document is refreshed. This value requires the IHTMLMetaElement::httpEquiv to be set with the refresh value.
url Location that is loaded when the document is refreshed. This value requires the IHTMLMetaElement::httpEquiv to be set with the refresh value.
mimetype MIME type used for the charset value.
charset Character set of the document. This value requires the mimetype value to be set with a valid MIME type, and the IHTMLMetaElement::httpEquiv to be set with the refresh value.
noopen Microsoft Internet Explorer 6 for Windows XP Service Pack 2 (SP2) and later. Hides the Open or Run button on the File Download dialog box. This value requires the IHTMLMetaElement::name attribute to be set with the DownloadOptions value.
nosave Internet Explorer 6 for Windows XP SP2 and later. Hides the Save button on the File Download dialog box. This value requires the IHTMLMetaElement::name attribute to be set with the DownloadOptions value.
x-ua-compatible Windows Internet Explorer 8 and later. A semi-colon–delimited list of document compatibility modes supported by the web page. This value requires the IHTMLMetaElement::httpEquiv to be set with the x-ua-compatible value.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

Developers using the httpEquiv and content attributes to refresh documents from alternate URLs should treat the value of content as untrusted data. For more information, please see Security Considerations: Dynamic HTML.

As of Internet Explorer 8, the IHTMLMetaElement::httpEquiv attribute also supports a value of x-ua-compatible, which allows developers to specify the document compatibility mode that Internet Explorer should use to display a webpage. To do this, set the content attribute to a BSTR value containing a comma-delimited list of one or more of the following values.

Value Description
IE=9 The webpage is displayed in IE9 Standards mode.
IE=8 The webpage is displayed in IE8 Standards mode.
IE=7 The webpage is displayed in IE7 Standards mode.
IE=5 The webpage is displayed in IE5 (Quirks) mode.
IE=EmulateIE9 If the webpage specifies a standards-based doctype directive, the page is displayed in IE9 mode; otherwise, it is displayed in IE5 mode.
IE=EmulateIE8 If the webpage specifies a standards-based doctype directive, the page is displayed in IE8 mode; otherwise, it is displayed in IE5 mode.
IE=EmulateIE7 If the webpage specifies a standards-based doctype directive, the page is displayed in IE7 mode; otherwise, it is displayed in IE5 mode.
IE=Edge The webpage is displayed in the highest mode available to the version of Internet Explorer used to view the page. This option is generally intended for testing purposes.

When the content attribute specifies multiple document modes, Internet Explorer displays the page in the highest mode supported by the browser. For more information, see Defining Document Compatibility.

See Also

IHTMLMetaElement::httpEquiv, meta, Defining Document Compatibility