好的,看jmpress的源代码,它来自跨域iframe消息传递。基本上 jmpress是这样做的:
window.addEventListener("message", function(event) {
// We do not test orgin, because we want to accept messages
// from all orgins
try {
var json = JSON.parse(event.data);
switch(json.type) {
case "select":
// TODO SECURITY filter targetId
$.each(eventData.settings.presentationMode.transferredValues, function(idx, name) {
eventData.current[name] = json[name];
});
$(eventData.jmpress).jmpress("select", {step: "#"+json.targetId, substep: json.substep}, json.reason);
break;
case "listen":
current.selectMessageListeners.push(event.source);
break;
case "ok":
clearTimeout(current.presentationPopupTimeout);
break;
case "read":
try {
event.source.postMessage(JSON.stringify({type: "url", url: window.location.href, notesUrl: eventData.settings.presentationMode.notesUrl}), "*");
} catch(e) {
$.error("Cannot post message to source: " + e);
}
break;
default:
throw "Unknown message type: " + json.type;
}
} catch(e) {
$.error("Recieved message is malformed: " + e);
}
});
因此,所有发布到主窗口的 iframe 都将通过此事件处理程序并在传递无效 JSON 时记录错误。看起来您的网站上有一个 facebook iframe,可以将消息发布到主窗口。尝试删除所有这些,看看错误是否消失。