drumhrd Posted February 11, 2010 Share Posted February 11, 2010 Ok I have tried and tried and cannot get this code to work in safari or google chrome. Basically I am working on a shopping cart. The user will click the paypal pay now button. The form is submitted to paypal via a new window target="_blank" I also need to refresh the current page. This will write shopping cart data to DB via php upon page refresh. Safari and google Chrome will open the paypal window, but seems to ignore the javascript to refresh the browser. FF and IE both work fine. <script LANGUAGE="JavaScript"> function newPage() { self.location.href=\'https://www.artists2you.com/s/orderconfirm.php?ordernumber='.$_SESSION['ordernumber'].'\'; } </script> <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_blank"" onSubmit=\'newPage()\'> Quote Link to comment Share on other sites More sharing options...
drumhrd Posted February 11, 2010 Author Share Posted February 11, 2010 Fixed..there was a timing issue. <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_blank"" onsubmit="setTimeout(newPage, 1000);"> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.