开发者

Open external link (HTTPS) with POST values inside Fancybox?

Is there a way to open external https urls, triggered on post submit and with post data inside Fancybox popups or similar?

I am talking about Paypal payments, for example. Clicking the "Buy Now" button, the PayPal website would open inside Fancybox and the data would be parsed using Ajax. This would i开发者_开发问答mprove the user experience, IMHO...

I tried this solution, found in another thread but it does not work...

$("#payment_form").bind("submit", function() {

$.ajax({
    type        : "POST",
    cache       : false,
    url         : "https://www.paypal.com/XXX/XXX",
    data        : $(this).serializeArray(),
    success: function(data) {
        $.fancybox(data);
    }
});

return false;

});

 <form id="payment_form"action="https://www.paypal.com/XXX/XXX" method="post">
 <input type="hidden" name="yyy" value="xxxx">
 <input type="hidden" name="yyy" value="xxxxxxxx">
 <input class="gift-card" type="image" src="button.jpg" name="submit" alt="">     
 </form>


PayPal is actively enforcing the X-FRAME-OPTIONS:DENY response header, so I doubt this would work.
Note that I haven't tested it yet though, but PayPal actively discourages anyone from 'embedding' their site in any way, shape or form, so even if it works today, you can't guarantee it'll work tomorrow.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜