AMPscript
Get
IsCHTMLBrowser
Post
Validate Your Server-Side JavaScript using WSProxy
Indicates whether the passed-in user agent value represents a CHTML browser. CHTML browsers, such as those found on feature phones, use a modified version of HTML to display information about smaller screens with fewer resources than smartphones. This function returns a value of true or false indicating whether the browser uses CHTML. Use this value to determine whether or not to display CHTML content.
IsCHTMLBrowser(1)
| Ordinal | Type | Description | |
|---|---|---|---|
| 1 | string | Required | Value indicating the browser using by the device |
This sample code evaluates the provided user-agent value and returns the appropriate value depending on the browser:
1Platform.Response.Write(Platform.Request.UserAgent);
2Platform.Response.Write("
3Is CHTML: ");
4Platform.Response.Write(Platform.Function.IsCHTMLBrowser(Platform.Request.UserAgent));