Print a Javascript object properties


function dump(obj, obj_name) {
var result = "";
for (var i in obj)
result += obj_name + "." + i + " = " + obj[i] + "\n";
return result;
}

alert ( dump(window, "window") );

No comments:

Post a Comment