似乎无法找到任何人来解决这个问题。只是想让<iframe>
BTN与父母交谈。
简单问题,需要在<iframe>
内部获取一个按钮来调用main.html上的函数。
设置如下:
<iframe>
内有products.php。传统的按钮内部products.php将main上的src更改为confirmation.php按预期工作。
问题出现在这里:在products.php上加载确认页面的方式如下:
private $base_url = "https://xxxxxxxx.com/";
$returnURL = $this->base_url . "confirmation.php";
产品页面<form>
提交称为此PHP。此操作以某种方式嵌入确认页面,或以不能与父级通信的方式附加它。
按钮&amp;确认功能.php:
<button type="button" onClick="test()">BACK</button>
<script>
function test() {
parent.mainTest();
}
</script>
以下所有内容均已在确认页面功能测试中失败。
main.html上的脚本:
<script>
function test (){
alert("Worked");
}
</script>
<iframe src="products.php" id="iframe1_id" name="iframe1"></iframe>