0
我想从iFrame(iframe.php)发送表单数据到iFrame的父级(main.php)。发送表单提交数据从iFrame到家长
main.php:
<div>
<iframe src="iframe.php"></iframe>
</div>
iframe.php:
<script>
// fancybox script here
$("#form_Submit").bind("submit", function() {
$.ajax({
type : "POST",
cache : false,
url : "/form.php",
data : $(this).serializeArray(),
success: function(data) {
parent.$.fancybox(data);
}
});
return false;
});
</script>
<form method="post" action="form.php" id="form_Submit">
<input type="text" name="someInput">
<button type="submit" name="submitForm">Submit</button>
</form>
我使用的代码,我发现在这里:Open Fancybox (or equiv) from Form input type="submit",但不能得到的形式在父显示。我一直试图让这个工作,但没有成功。谁能帮忙?先谢谢你。