Name

global.DetermineMobileDevice

Description

Determine whether a device is to use the mobile UI.

Script

gs.include("PrototypeServer");

var DetermineMobileDevice = Class.create();
DetermineMobileDevice.prototype = {
 
 initialize : function() {
 },
 
 /**
  * Determine whether the mobile interface should be used.
  *
  * Inputs: 
  *    A variable named "user_agent" contains the User Agent string from the browser.
  *
  * Returns:
  *    true - Use the mobile interface.
  *    false - do not use the mobile interface.
  */
 determine: function() {
    if (user_agent.indexOf("Windows CE") > -1) 
       return true;
    if (user_agent.indexOf("BlackBerry") > -1)
       return true;
    if (user_agent.indexOf("Android") > -1)
       return true;
    if (user_agent.indexOf("iPhone") > -1)
       return true;
    if (user_agent.indexOf("Opera Mini") > -1)
       return true;
    return false;
 },

 type: "DetermineMobileDevice"
}

Sys ID

2ad962170a0a0b1e00e65d20aa9fc02f

Offical Documentation

Official Docs: