Monday, 4 February 2013

jQuery Type Testing Functions

  • Determine the type of an object
  • Useful for optional parameters & validation

Functions:
  • $.isArray(array)
  • $.isFunction(function) - another way to do this ( if (typeof <functionName> == "function")
  • $.isEmptyObject(object)
  • $.isPlainObject(object)
  • $.isXmlDoc(doc)
  • $.isNumeric(number)
  • $.isWindow(window)
  • $.type(object)

 Return Values:
  • boolean
  • number
  • string
  • function
  • array
  • date
  • regexp
  • object
  • undefined
  • null

No comments:

Post a Comment