Easy Tutorial
❮ Jquery Tutorial Traversing Children ❯

jQuery.isPlainObject() Method

jQuery Miscellaneous Methods

Example

Determine if an object is a plain object.

$(function () { 
    function fun( html ){ 
        document.body.innerHTML += "<br>" + html; 
    } 
    fun($.isPlainObject({}));   //true
    fun($.isPlainObject( "test" ));  //false
    fun($.isPlainObject(document.location)); // false , returns true in IE 8
})

Definition and Usage

The $.isPlainObject() function is used to determine if the specified argument is a plain object.

Note: Host objects (or other objects used by the browser host environment to complete the ECMAScript execution environment) are difficult to feature-test across platforms. Therefore, for instances of these objects, $.isPlainObject() may yield different results across different browsers.


Syntax

Parameter Description
object Any type The arbitrary value to be evaluated.

jQuery Miscellaneous Methods

❮ Jquery Tutorial Traversing Children ❯