Sha256: 862dba8b32eb287d3279c868f3507b337232fbdfa76573a8d81aa7e58f48eaad
Contents?: true
Size: 715 Bytes
Versions: 105
Compression:
Stored size: 715 Bytes
Contents
var sys = require("util") , assert = require("assert") , XMLHttpRequest = require("../lib/XMLHttpRequest").XMLHttpRequest , xhr; xhr = new XMLHttpRequest(); xhr.onreadystatechange = function() { if (this.readyState == 4) { assert.equal("Hello World", this.responseText); this.close(); runSync(); } }; // Async var url = "file://" + __dirname + "/testdata.txt"; xhr.open("GET", url); xhr.send(); // Sync var runSync = function() { xhr = new XMLHttpRequest(); xhr.onreadystatechange = function() { if (this.readyState == 4) { assert.equal("Hello World", this.responseText); this.close(); sys.puts("done"); } }; xhr.open("GET", url, false); xhr.send(); }
Version data entries
105 entries across 105 versions & 4 rubygems