Created
May 10, 2014 18:54
-
-
Save DirkyJerky/a29bba43e5a559a23b19 to your computer and use it in GitHub Desktop.
List the properties of a javascript object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var depth = 1; | |
var br = '<br />'; | |
var target = document; | |
$.each(Object.keys(target), function(K1, V1) { | |
document.write('"' + V1 + '" : "' + target[V1] + '" [' + (typeof target[V1]) + ']' + br); | |
/* | |
if(((typeof target[V1]) == 'object') && target != target[V1]) { | |
var target2 = target[V1]; | |
$.each(Object.keys(target2), function(K2, V2) { | |
console.log(K1 + '.' + K2 + ': "' + V2 + '" -> "' + target2[V2] + '"'); | |
}); | |
} | |
*/ | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment