1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-07-05 01:28:39 +00:00

Fix XHR failure for file: protocol.

This commit is contained in:
Duan Yao 2014-06-07 00:51:19 +08:00
parent 5ce2cf7a80
commit ceea8193d8

View File

@ -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;