简体   繁体   English

iframe网址更改时如何触发提交按钮

[英]how to Trigger a submit button when Iframe url change

我使用了第三方iframe src,并且我想在更改iframe src时提交表单...如何在内部iframe源更改时触发提交按钮?

how to trigger the submit button when the inner Iframe source change?

You can't access iframe content if it belongs to different domain. 如果iframe内容属于其他域,则无法访问。

I use a third party iframe src

So defenitly not as its other domain 所以辩护不像它的其他领域

Also from w3school 也来自w3school

Note: Because of security reasons, the contents of a document can be accessed from another document only if the two documents are located in the same domain.

I changed the redirected page and add on it 我更改了重定向页面并添加

<body onload="parent.parent.send()">

On the main page (where the iframe located) I add: 在主页上(iframe所在的位置)添加:

<script>
function send()
{
document.getElementById("gform_1").submit();
}
</script> 

It solve my problem. 它解决了我的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM