1 line
1.4 KiB
JSON
1 line
1.4 KiB
JSON
{"name":"jQuery.isPlainObject","type":"method","title":"jQuery.isPlainObject()","deprecated":null,"removed":null,"desc":"Check to see if an object is a plain object (created using \"{}\" or \"new Object\").","categories":["utilities","version/1.4"],"entries":[{"return":"Boolean","signatures":{"added":"1.4","argument":{"desc":"The object that will be checked to see if it's a plain object.","name":"object","type":"PlainObject"}},"examples":{"desc":"Check an object to see if it's a plain object.","code":"\njQuery.isPlainObject({}) // true\njQuery.isPlainObject( \"test\" ) // false\n"},"longdesc":"\n <p><strong>Note:</strong> Host objects (or objects used by browser host environments to complete the execution environment of ECMAScript) have a number of inconsistencies which are difficult to robustly feature detect cross-platform. As a result of this, <code>$.isPlainObject()</code> may evaluate inconsistently across browsers in certain instances.</p>\n <p>An example of this is a test against <code>document.location</code> using <code>$.isPlainObject()</code> as follows:</p>\n <pre><code>\nconsole.log( $.isPlainObject( document.location ) );\n </code></pre>\n <p>which throws an invalid pointer exception in IE8. With this in mind, it's important to be aware of any of the gotchas involved in using <code>$.isPlainObject()</code> against older browsers. A couple basic examples that do function correctly cross-browser can be found below.</p>\n "}]} |