From: Andreas Gal Date: Thu, 12 May 2011 04:13:27 +0000 (-0700) Subject: 0 is error for http, only MS would design this API X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=0413fb7f6ced499ae915ee0683d7890799234660;p=pdf.js.git 0 is error for http, only MS would design this API --- diff --git a/test.html b/test.html index e625f4b..767923e 100644 --- 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;