From ceea8193d851c76fbb53ef997844e532550b2806 Mon Sep 17 00:00:00 2001 From: Duan Yao Date: Sat, 7 Jun 2014 00:51:19 +0800 Subject: [PATCH] Fix XHR failure for file: protocol. --- share/pdf2htmlEX.js.in | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/share/pdf2htmlEX.js.in b/share/pdf2htmlEX.js.in index 25352fe..f21d3df 100644 --- a/share/pdf2htmlEX.js.in +++ b/share/pdf2htmlEX.js.in @@ -372,9 +372,8 @@ Viewer.prototype = { var _idx = idx; var xhr = new XMLHttpRequest(); xhr.open('GET', url, true); - xhr.onreadystatechange = function(){ - if (xhr.readyState != 4) return; - if (xhr.status === 200) { + xhr.onload = function(){ + if (xhr.status === 200 || xhr.status === 0) { // find the page element in the data var div = document.createElement('div'); div.innerHTML = xhr.responseText;