【问题标题】:How can I execute function from the xhtml with frame? [duplicate]如何从带有框架的 xhtml 执行功能? [复制] 【发布时间】:2014-07-16 11:19:29 【问题描述】: 如图所示,如何在 x 应用程序中执行示例函数? http://imageshack.com/a/img834/52/xvso.png 【问题讨论】: 标签: javascript iframe 【解决方案1】: 家庭作业?见invoking-javascript-code-in-an-iframe-from-the-parent-page。 在你的情况下: document.getElementById('test-iframe').contentWindow.sample(args); 【讨论】: 不是作业。是的 window.parent 工作,但我收到浏览器错误。 "SecurityError: Blocked a frame with origin "10.0.0.97:8082" 无法访问跨域框架。" 如果可以,请从同一个域同时提供服务。见stackoverflow.com/questions/19837354/…