访问iframe表单父页面javascript中的输入字段值

时间:2016-05-18 17:34:01

标签: javascript php html google-chrome iframe

有几个帖子,但没有解决方案适合我。 我在加载parent.com

中有child.com和iframe

我想访问child.com(iframe内部)中的输入字段的值

这是我到目前为止所尝试的内容

document.getElementById("iframeID").contentWindow.document.getElementById("input").value;

jQuery("#iframeID").contents().find('#input').val();

window.frames[0].getElementById("input").value;

jQuery('iframe[name=iframe]').contents().find('#input').val();

每次尝试都会产生相同的反应

Blocked a frame with origin "parent.com" from accessing a frame with origin "child.com". Protocols, domains, and ports must match.

我不知道这对其他人有用,许多人接受了这些答案。

0 个答案:

没有答案
相关问题