003.js (542B)
1 onconnect = function(e) { 2 var xhr = new XMLHttpRequest(); 3 var log = ''; 4 var port = e.ports[0]; 5 var postMessage = port.postMessage; 6 xhr.onreadystatechange = function(e) { 7 if (this.readyState == 4) { 8 if (this.responseXML != null) 9 log += 'responseXML was not null. '; 10 if (this.responseText && this.responseText != '<x>foo</x>') 11 log += 'responseText was ' + this.responseText + ', expected <x>foo</x>. '; 12 postMessage.call(port, log); 13 } 14 } 15 xhr.open('GET', '001-1.xml', true); 16 xhr.send(); 17 }