EMS.Util

EMS.Util is the namespace for all utility functions

Summary
EMS.UtilEMS.Util is the namespace for all utility functions
Static Functions
typeOf
toJSON
fromJSON
toAbsoluteUrlConvert a relative URL into an absolute URL.

Static Functions

typeOf

EMS.Util.typeOf = function(obj)

Parameters

obj{Object} is the object to test.

Example

var string = "hello";
EMS.Util.typeOf(string);  // Returns "string"

Returns

{String} The string name of the of the type.  It will return false if null or undefined.  The following results will be returned:

  • element if the object is a DOM element.
  • textnode if the object is a DOM text node.
  • whitespace if the object is a DOM whitespace node.
  • array if the object is an {Array}.
  • object if the object is an {Object}.
  • string if the object is a {String}.
  • number if the object is a {Number}.
  • boolean if the object is a {Boolean}.
  • function if the object is a {Function}.

toJSON

EMS.Util.toJSON = function(object)

Paramters

object{Object} is the object to covert.

Returns

{String} a string representing the object in JSON.

fromJSON

EMS.Util.fromJSON = function(string)

Paramters

string{String} is the JSON string to evaluate.

Returns

{Object}

toAbsoluteUrl

EMS.Util.toAbsoluteUrl = function(url)

Convert a relative URL into an absolute URL.

Parameters

url{String} relative url.

Returns

{String} absolute URL.

EMS.Util.typeOf = function(obj)
EMS.Util.toJSON = function(object)
EMS.Util.fromJSON = function(string)
EMS.Util.toAbsoluteUrl = function(url)
Convert a relative URL into an absolute URL.
Close