【发布时间】:2014-08-20 08:19:38
【问题描述】:
我在 iframe 中动态创建 pdf:
<iframe name="output" id="output"></iframe>
并尝试从中打印:
window.frames["output"].focus();
window.frames["output"].print();
但是在这个例子中你怎么看:
它打印一个空白站点。
【问题讨论】:
-
我以为我可以添加一个 setTimeout 但 Chrome 给了我
Uncaught SecurityError: Blocked a frame with origin "http://fiddle.jshell.net" from accessing a frame with origin "null". The frame requesting access has a protocol of "http", the frame being accessed has a protocol of "data". Protocols must match. -
如果您可以将 pdf javascript 添加到文件本身以打印自己 - stackoverflow.com/a/13992297/295783
标签: javascript jquery iframe