General Utility Functions

Methods that allow you to access the Mobile Workflow general utility functions.

All of general utility functions are synchronous.

Method Description
guid() Generates a unique string.
trimSpaces(str) Removes spaces from the specified string.

str – the specified string.

escapeValue(val) Replaces all instances in the specified string:
  • Of the & character with '&'.
  • Of the < character with '&lt;'.
  • Of the > character with '&gt;'.
  • Of the " (quotation mark) character with '&quot;'.
  • Of the ' (apostrophe) character with '&apos;'.

val – the specified value. Returns the escaped value.

unescapeValue(val) Replaces all instances in the specified string:
  • Of the '&amp;' substring with ‘&’.
  • Of the '&lt;’ substring with '<’.
  • Of the ‘&gt;’ substring with ‘>’.
  • Of the ‘&quot;’ substring with '"'.
  • Of the ‘&apos;’ substring with '''.

val – the specified value. Returns the escaped value.

isIOS() Returns true if the Mobile Workflow application is running on an iOS platform.
isBlackBerry() Returns true if the Mobile Workflow application is running on a BlackBerry platform.
isWindowsMobile() Returns true if the Mobile Workflow application is running on a Windows Mobile platform.
isWindows() Returns true if the Mobile Workflow application is running on a Windows platform.
getAttribute(elem, attribName) Reliably returns the specified attribute value for the specified HTML element.
  • elem – the specified HTML element.
  • attribName – the attribute name.
getElementsByTagName(El, tagName) Reliably returns the list of elements with the specified tag name, searching only the subtree underneath the specified element.
  • el – the specified HTML element.
  • tagName – the specified tag name.
getFormElementById(formEl, elemID) Returns the form element with the specified ID.
  • formEl – the form element.
  • elemId – the specified ID.
getXMLHTTPRequest() Reliably returns an XMLHttpRequest object.
Note: This method is supported only on BlackBerry and Windows Mobile platforms.
getURLParam(paramName) Returns the specified parameter value from the current URL (window.location.href).

paramName – the specified parameter name.