Follow

Device Sensor

The Device Sensor detects information about the current display, including browser, browser version, OS, language, client (window) width, and total screen width. It can be used to change behavior and display, depending on the platform the Coach is being run on (such as displaying a mobile version on phones).

Like almost all SPARK controls, you can trigger events that are fired when the user interacts with the control (see the Event and Methods sections below and the Event Handling article for more information).

This control needs to be used in conjunction with other controls in order to display device information.

Example

This is the configuration option for the Device Control...

Using the getDeviceInfo method, information about the device can be displayed.  This example uses two Output Text controls...

Note: The Control Id for the Device Sensor is Sensor

This is the result...

Events

With the Device Sensor, there is 1 type of event handler:

  • On Load When the page loads

You can use JavaScript logic to affect the effects of the control, depending on the event. More information on using these controls can be found in the Event Handling article.

Methods

For detailed information on the available methods for this control, access the JS Doc file.

 

  • Author: Courtney Silva
  • Date Created: June 21, 2015
  • Date Modified: July 27, 2015
Was this article helpful?
0 out of 0 found this helpful

Comments