]> git.parisson.com Git - pdf.js.git/commitdiff
0 is error for http, only MS would design this API
authorAndreas Gal <andreas.gal@gmail.com>
Thu, 12 May 2011 04:13:27 +0000 (21:13 -0700)
committerAndreas Gal <andreas.gal@gmail.com>
Thu, 12 May 2011 04:13:27 +0000 (21:13 -0700)
test.html

index e625f4bf16d7a090e65c7b700b217429623be584..767923ef88147dd8fea5a6b2b6baa74c9d766329 100644 (file)
--- a/test.html
+++ b/test.html
@@ -29,12 +29,13 @@ function load() {
 
     req = new XMLHttpRequest();
     req.open("GET", "uncompressed.tracemonkey-pldi-09.pdf");
+    req.expected = 0; // 200 for HTTP
     req.onreadystatechange = xhrstate;
     req.send(null);
 }
 
 function xhrstate() {
-    if (req.readyState == 4 && (req.status == 200 || req.status == 0)) {
+    if (req.readyState == 4 && req.status == req.expected) {
         var data = req.mozResponseArrayBuffer;
         pdf = new PDFDoc(new Stream(data));
         numPages = pdf.numPages;