To POST to an iframe you must use form target
<form id="moodleform" target="iframe"
method="post" action="http:// example.com/ login/index.php"
>
<input type="hidden" name="username" value="guest"/>
<input type="hidden" name="password" value="guest"/>
<input type="hidden" name="testcookies" value="1"/>
</form>
<iframe name="iframe"></iframe>
<script type="text/javascript">
document.getElementById('moodleform').submit();
</script>
Ref:stackoverflow. com/questions/3803320 / sending-data-through-post-method-to-an-iframe
评论
发表评论