Skip to content

Instantly share code, notes, and snippets.

@kriszyp
Created January 20, 2010 03:07
Show Gist options
  • Save kriszyp/281562 to your computer and use it in GitHub Desktop.
Save kriszyp/281562 to your computer and use it in GitHub Desktop.
XMLHttpRequest = require("browser/xhr").XMLHttpRequest;
var request = require("jsgi-client").request;
var when = require("promise").when;
var queue = require("event-queue");
when(request({
method: "GET",
url: "http://google.com/"
}), function(response) {
print("Google responded with " + response.body);
queue.shutdown();
});
queue.enterEventLoop();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment