jQuery Dump $.dump( object ):$( selection ).dump() 介绍
A attempt to port the PHP function print_r to javascript and jQuery. It simply
returns a nested string containing @R_513_4045@ion about the passed object.
Returns @R_513_4045@ion about:
-
Strings
-
Numbers
-
Booleans
-
Dates
-
Arrays
-
Objects
-
jQuery Objects
-
RegExp
-
Errors
-
DOMElements
-
Functions
Usage:
$.dump( object ):
<pre id="dump"></pre> <script type="text/javascript"> $(document).ready(function(){ var obj = { hubba: "Some string...", bubba: 12.5, dubba: ["One", "Two", "Three"] } $("#dump").append($.dump(obj)); }); </script>
Should result in:
Object { hubba: "Some string..." bubba: 12.5 dubba: Array ( 0 => "One" 1 => "Two" 2 => "Three" ) }
$( selection ).dump()
`
Hubba bubba dubba
`
Should result in:
jQuery Object { 0 = DOMElement [ nodeName: P nodeValue: null innerHTML: [ 0 = String: Hubba 1 = DOMElement [ nodeName: SPAN nodeValue: null innerHTML: [ 0 = String: bubba ] ] 2 = String: dubba ] ] }
jQuery Dump $.dump( object ):$( selection ).dump() 官网
http://plugins.jquery.com/project/Dump
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。