GetDeviceInfo method: Request class

Syntax

GetDeviceInfo(attribute)

Description

Use the GetDeviceInfo method to detect and return a value for the specified device attribute.

Important:

Use this method within fluid applications only.

Parameters

Parameter Description

attribute

Specifies one of the listed device attributes as a string value:

Attribute Returns

width

The device's width in physical pixels.

height

The device's height in physical pixels.

pixelratio

The ratio between physical pixels and device-independent pixels (dips) on the device.

touch

Whether the device supports touch events:

  • 1 – Supports

  • 0 – Does not support.

geolocation

Whether the device supports the geolocation API:

  • 1 – Supports

  • 0 – Does not support.

websockets

Whether the device supports the WebSockets API:

  • 1 – Supports

  • 0 – Does not support.

webworkers

Whether the device supports the Web Workers API:

  • 1 – Supports

  • 0 – Does not support.

datepicker

Whether the device supports the DatePicker widget:

  • 1 – Supports

  • 0 – Does not support.

dtpicker

Whether the device supports the DateTimePicker widget:

  • 1 – Supports

  • 0 – Does not support.

timepicker

Whether the device supports the TimePicker widget:

  • 1 – Supports

  • 0 – Does not support.

dnd

Whether the device natively supports drag-and-drop:

  • 1 – Supports

  • 0 – Does not support.

sessionstorage

Whether the device supports the sessionStorage object:

  • 1 – Supports

  • 0 – Does not support.

localstorage

Whether the device supports the localStorage object:

  • 1 – Supports

  • 0 – Does not support.

history

Whether the device supports the history API:

  • 1 – Supports

  • 0 – Does not support.

canvas

Whether the device supports the <canvas> element:

  • 1 – Supports

  • 0 – Does not support.

svg

Whether the device supports the Scalable Vector Graphics (SVG) format:

  • 1 – Supports

  • 0 – Does not support.

postmessage

Whether the device supports the method:

  • 1 – Supports

  • 0 – Does not support.

hc

Whether the device supports a high contrast mode:

  • 1 – Supports

  • 0 – Does not support.

Returns

An Integer value.

Example

&dev_info = %Request.GetDeviceInfo("width");