Mercurial > hg > nodescore
annotate node_modules/xmlhttprequest/example/demo.js @ 99:9641c2572988
osc modifications for operation integratus performance
author | Rob Canning <rob@foo.net> |
---|---|
date | Mon, 08 Dec 2014 21:30:23 +0000 |
parents | cd921abc8887 |
children |
rev | line source |
---|---|
rob@77 | 1 var sys = require('util'); |
rob@77 | 2 var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest; |
rob@77 | 3 |
rob@77 | 4 var xhr = new XMLHttpRequest(); |
rob@77 | 5 |
rob@77 | 6 xhr.onreadystatechange = function() { |
rob@77 | 7 sys.puts("State: " + this.readyState); |
rob@77 | 8 |
rob@77 | 9 if (this.readyState == 4) { |
rob@77 | 10 sys.puts("Complete.\nBody length: " + this.responseText.length); |
rob@77 | 11 sys.puts("Body:\n" + this.responseText); |
rob@77 | 12 } |
rob@77 | 13 }; |
rob@77 | 14 |
rob@77 | 15 xhr.open("GET", "http://driverdan.com"); |
rob@77 | 16 xhr.send(); |