-
-
Save anonymous/064e49090300f8bfa36f to your computer and use it in GitHub Desktop.
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
uncaught exception: [Exception... "Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOM3Document.domConfig]" nsresult: "0x80004001 (NS_ERROR_NOT_IMPLEMENTED)" location: "JS frame :: http://localhost:8000/test.js :: run :: line 53" data: no] |
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 request = "window.document"; | |
>>> var result = new Array; | |
>>> var i = 0; | |
>>> eval('for(key in '+request+'){result[i]=eval("typeof '+request+'."+key);result[i+1]="'+request+'."+key;i+=2;}'); | |
>>> result.length | |
304 |
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
// Dean Edwards/Matthias Miller/John Resig | |
function init() { | |
// quit if this function has already been called | |
if (arguments.callee.done) return; | |
// flag this function so we don't do the same thing twice | |
arguments.callee.done = true; | |
// kill the timer | |
if (_timer) clearInterval(_timer); | |
// do stuff | |
run(); | |
}; | |
/* for Mozilla/Opera9 */ | |
if (document.addEventListener) { | |
document.addEventListener("DOMContentLoaded", init, false); | |
} | |
/* for Internet Explorer */ | |
/*@cc_on @*/ | |
/*@if (@_win32) | |
document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>"); | |
var script = document.getElementById("__ie_onload"); | |
script.onreadystatechange = function() { | |
if (this.readyState == "complete") { | |
init(); // call the onload handler | |
} | |
}; | |
/*@end @*/ | |
/* for Safari */ | |
if (/WebKit/i.test(navigator.userAgent)) { // sniff | |
var _timer = setInterval(function() { | |
if (/loaded|complete/.test(document.readyState)) { | |
init(); // call the onload handler | |
} | |
}, 10); | |
} | |
/* for other browsers */ | |
window.onload = init; | |
/* End Dean Edwards/Matthaias Miller/John Resig */ | |
function run() { | |
var request = "window.document"; | |
var result = new Array; | |
var i = 0; | |
eval('for(key in '+request+'){result[i]=eval("typeof '+request+'."+key);result[i+1]="'+request+'."+key;i+=2;}'); | |
console.log(result); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment