开发者

set form target and submit it in safari

Need some help. This javascript code should set the target of th开发者_JAVA技巧e form and submit it. doesn't work in safari 5.0.2 ... why???

<html>
    <body>You will be redirected to PayPal in a few seconds.
    <form action="https://www.paypal.com/webscr" id="paypal_standard_checkout" name="paypal_standard_checkout" method="POST">
     <input id="business" name="business" value="test@testxyz.com" type="hidden"/>
    </form>
    <script type="text/javascript">
     document.getElementById("paypal_standard_checkout").setAttribute("target","payment"); 
     document.getElementById("paypal_standard_checkout").submit();
    </script>
    </body>
    </html>


Didn't work for me in Safari 5.0.1 then i unchecked 'Block Pop-Up Windows' from the edit menu and then it was working fine :)

Code seems to be working fine, just being blocked.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜