我的页面上有一个显示 XML 文档的 iFrame。
<iframe id="iFrame2" name="iFrame2" width="100%" height="100%">
我需要从父页面访问 iFrame 中的 XML 文档。我该怎么做?
当我尝试时:
console.log(iFrame2.document);
我收到以下错误:
Permission denied for <http://localhost:3000> to get property Window.document from <http://www.imageshack.us>.
最佳答案
请参阅 comp.lang.javascript 常见问题解答:
关于html - 如何访问 iFrame 中的 XML 文档?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3278707/