Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Meta httpEquiv Property

Meta httpEquiv Property

Meta Object Reference Meta Object


Definition and Usage

The httpEquiv property sets or returns the HTTP header information in the content property.

The http-equiv property can be used to simulate HTTP response header information.

The http-equiv property value depends on the value of the content property.

**Note:** If the name property is already set, the http-equiv property does not need to be set.

Syntax

Set the httpEquiv property:

linkObject.httpEquiv="

HTTP-header

"

Return the httpEquiv property:

linkObject.httpEquiv

Some commonly used HTTP-header values:

Value Description
cache-control Controls the caching mechanism of the document.

Allowed values:

  • public - all content will be cached (both client and proxy servers can cache)
  • private - content is cached only in the private cache (only the client can cache, the proxy server cannot cache)
  • no-cache - do not cache
  • no-store - cached but not archived
  • Example:

    | | content-language | the language of the response body

    Example:

    | | content-type | the MIME type of the returned content

    Tip: Usually used for character set settings.

    Example:

    | | date | the time the origin server sent the message

    Example:

    | | expires | the date and time when the response expires

    Example:

    | | last-modified | the last modification time of the requested resource

    Example:

    | | location | used to redirect the recipient to a non-requested URL location to complete the request or identify a new resource

    Example:

    | | refresh | defines how long to wait before refreshing the page.

    Example:

    | | set-cookie | creates a cookie containing the cookie name, cookie value, and expiration time.

    Example:

    | | window-target | specifies the name of the frame to load |

    Browser support

    Internet ExplorerFirefoxOperaGoogle ChromeSafari

    All major browsers support the httpEquiv property


    Example

    Example

    Display HTTP header information:

    Runoob Tutorial(runoob.com)

    Try it »


    Meta Object Reference Meta Object