IsChtmlBrowser()

Returns a value that indicates if a device's user agent is a CHTML browser.

CHTML or Compact HTML is a variant of HTML that was designed for use on non-smart feature phones, and on early smartphones and PDAs. It was intended to display information on smaller screens with fewer resources. This function was intended for use with landing pages to determine whether to display standard HTML content or CHTML content.

The CHTML standard was superseded in the early 2000s and is now rarely used. This documentation is maintained for historical purposes.

Note

Syntax 

IsChtmlBrowser(userAgentHeader)

The IsChtmlBrowser() function has one parameter:

  • userAgentHeader (string): Required. An HTTP user-agent header string.

Usage 

To use the function, pass it an HTTP user-agent header string. This example checks to see if a pre-defined string supports CHTML.

%%[
  IsChtmlBrowser("Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/117.0")
]%%

The function returns false because the user agent corresponds to a modern desktop web browser.

You can combine this function with other AMPscript functions. This example uses the HttpRequestHeader() function to return the browser user-agent value from the current browser.

%%[
  IsChtmlBrowser(HttpRequestHeader("user-agent"))
]%%

The function returns the appropriate value for the provided user-agent value.

See Also