Skip to content

Instantly share code, notes, and snippets.

@kasima
Created August 18, 2010 09:42
Show Gist options
  • Save kasima/534185 to your computer and use it in GitHub Desktop.
Save kasima/534185 to your computer and use it in GitHub Desktop.
<html>
<head>
</head>
<body>
</body>
<script type="text/javascript">
function dump_object(obj, seed) {
var s = seed;
s += "<p>" + obj + "</p>";
s += "<table>\n";
s += "<tr><th>attr</th><th>type</th><th>val</tr>\n";
for (var p in obj) {
s += "<tr>";
s += "<td>" + p + "</td>";
s += "<td>" + typeof(obj[p]) + "</td>";
if (typeof(obj[p]) == 'object') {
s += "<td>";
s += dump_object(obj[p], "");
s += "</td>";
}
else {
s += "<td><pre>" + obj[p] + "</pre></td>";
}
s += "</tr>\n";
}
s += "</table>\n";
return s;
}
function a() {
return b();
}
function b() {
return c();
}
function c() {
try {
(0)();
}
catch (e) {
return dump_object(e, "");
}
}
var e = document.getElementById('error_div');
// e.innerHTML = "<textarea>" + a() + "</textarea>";
e.innerHTML = "<pre>" + a() + "</pre>";
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment