Skip to content

Instantly share code, notes, and snippets.

@getify
Created May 4, 2010 07:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save getify/a73c0f06a46962500dc8 to your computer and use it in GitHub Desktop.
Save getify/a73c0f06a46962500dc8 to your computer and use it in GitHub Desktop.
var data;
(function(){
var x = new XMLHttpRequest();
data["abc"] = {};
data["abc"]["def"] = x;
data["abc"]["wxy"] = x;
})();
(function(){
data["abc"]["foobar"] = function(){
if (data["abc"]["wxy"].readyState == 4) {
alert(data["abc"]["wxy"].responseText);
}
}
})();
(function(){
data["abc"]["def"].onreadystatechange = data["abc"]["foobar"];
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment