简体   繁体   中英

Javascript to close window while using <button>

I have a Magento store running inside of a frameset. Paypal recently updated their framebusting script which ended up disabling our store's ability to process payments.

I've ended up changing the code that renders the Checkout button to launch Paypal in a new window and in that window I've successfully set it up to be able to return to the confirmation page.

However in the original window I'm left with a blank screen inside of our iframe. What i'd like to do is have this window close when the new window is launched but I'm having difficulty doing so. This is the code that I'm using:

<button type="submit" title="<?php echo $this->__('Place Order') ?>" class="button btn-checkout" onclick="review.save(); window.open('http://auxout.com/shop/paypal/standard/redirect/')"><span><span><?php echo $this->__('Place Order') ?></span></span></button>

Since this button is inside the <iframe> I haven't been able to close the initial window. How can accomplish this?

window.close to close window but i think you cannot close parent window. Why not open paypal in same window rather than new window

最后,解决方案是更改为CSS并重新设置其样式

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM