Latest web development tutorials

jQuery.isPlainObject () method

jQuery Misc Methods jQuery Misc Methods

Examples

Determining whether the object is a pure object.

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

try it"

Definition and Usage

$ .isPlainObject () Function is used to determine whether the specified parameter is a pure object.

Note: The host object (or other objects used by the browser host environment for the completion of the execution environment of ECMAScript) is difficult to detect characteristics of cross-platform. Thus, for instance these objects, $. IsPlainObject () may yield different results on different browsers.


grammar

$.isPlainObject( object )

参数 描述
object 任意类型 需要进行判断的任意值。


jQuery Misc Methods jQuery Misc Methods