|
|
@@ -308,7 +308,6 @@ function loadData() {
|
|
|
// 处理后台传输的自定义的换行标志
|
|
|
var result = JSON.parse(XMLHttpRequest.responseText);
|
|
|
var message = result.message;
|
|
|
- console.log(message);
|
|
|
$("#message").html(message);
|
|
|
if (result.detailedMessage) {
|
|
|
$("#detailedMessageButton").removeAttr("hidden");
|
|
|
@@ -317,13 +316,6 @@ function loadData() {
|
|
|
$("#detailedMessage").html(result.detailedMessage);
|
|
|
$("#detailedMessage").removeAttr("hidden");
|
|
|
});
|
|
|
- // var p = document.createElement("p");
|
|
|
- // p.style.color = "#fff";
|
|
|
- // p.style.textAlign = "left";
|
|
|
- // p.style.marginLeft = "20px";
|
|
|
- // 将返回的错误信息显示在页面上
|
|
|
- // p.textContent = XMLHttpRequest.responseText;
|
|
|
- // viewerContainer.appendChild(p);
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
@@ -342,8 +334,8 @@ function loadWholePdf() {
|
|
|
hiddenFrameLoaded = true;
|
|
|
return;
|
|
|
}
|
|
|
- // 绑定onload事件
|
|
|
- hiddenFrame.onload = function() {
|
|
|
+
|
|
|
+ var hiddenFrameOnload = function() {
|
|
|
// 加载失败时(pdf文件不存在,404错误),title不为null
|
|
|
// 此时等待一段时间再重新加载
|
|
|
if (hiddenFrame.contentDocument.title) {
|
|
|
@@ -368,6 +360,14 @@ function loadWholePdf() {
|
|
|
$.publish("hiddenFrameLoaded");
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
+ // 绑定onload事件
|
|
|
+ // 低版本Chrome浏览器的onload事件
|
|
|
+ if (hiddenFrame.attachEvent) {
|
|
|
+ hiddenFrame.attachEvent("onload", hiddenFrameOnload)
|
|
|
+ } else {
|
|
|
+ hiddenFrame.onload = hiddenFrameOnload;
|
|
|
+ }
|
|
|
// 开始加载
|
|
|
console.log(new Date().format() + " ---- hiddenFrame loading...");
|
|
|
hiddenFrame.src = wholePdfPath;
|