<iframe id="qrcode-iframe" name="submitIframe" src="about:blank" width="100%" height="750px" frameborder="no" border="0" marginwidth="0" marginheight="0" > </iframe> <script> $(function() { var form = "<form id="alipaysubmit" name="alipaysubmit" action="https://mapi.alipay.com/gateway.do?_input_charset=utf-8" method="get" target="submitIfram"></form><script>document.forms['alipaysubmit'].submit();</script>"; $("#qrcode-iframe").append($(form)); }); </script>
指定表单的target为iframe的name即可
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/14044.html