Browse Source

修复Firefox下上传图片返回json数据为undefined的问题

master
商讯在线 10 years ago
parent
commit
4294250fea
  1. 7
      plugins/image-dialog/image-dialog.js

7
plugins/image-dialog/image-dialog.js

@ -150,7 +150,12 @@
uploadIframe.onload = function() {
loading(false);
var json = uploadIframe.contentWindow.document.body.innerText;
var json = "";
if (uploadIframe.contentWindow) {
json = uploadIframe.contentWindow.document.body ? uploadIframe.contentWindow.document.body.innerHTML : null;
} else if (uploadIframe.contentDocument) {
json = uploadIframe.contentDocument.document.body ? uploadIframe.contentDocument.document.body.innerHTML : null;
}
json = (typeof JSON.parse !== "undefined") ? JSON.parse(json) : eval("(" + json + ")");
if (json.success === 1)

Loading…
Cancel
Save