【问题标题】:How to open checkout in new window? simplecartjs 3.0.5如何在新窗口中打开结帐? simplecartjs 3.0.5
【发布时间】:2014-11-07 02:36:58
【问题描述】:

我正在尝试这样做,但它不起作用

<i> extendCheckout: function (methods) {
    return simpleCart.extend(simpleCart.checkout, methods);
            },
            generateAndSendForm: function (opts) {
                var form = simpleCart.$create("form");
                form.attr('style', 'display:none;');
                form.attr('action', opts.action);
                form.attr('method', opts.method);



                simpleCart.each(opts.data, function (val, x, name) {
                    form.append(
                        simpleCart.$create("input").attr("type","hidden").attr("name",name).val(val)
                    );
                });

                simpleCart.$("body").append(form);

                form.el.submit();
                form.remove();

            }
        });

        simpleCart.extendCheckout({
            PayPal: function (opts) {
                // account email is required
                if (!opts.email) {
                    return simpleCart.error("No email provided for PayPal checkout");
                }

                // build basic form options
                var data = {
                          cmd           : "_cart"
                        , upload        : "1"
                        , currency_code : simpleCart.currency().code
                        , business      : opts.email
                        , rm            : opts.method === "GET" ? "0" : "2"
                        , tax_cart      : (simpleCart.tax()*1).toFixed(2)
                        , handling_cart : (simpleCart.shipping()*1).toFixed(2)
                        , charset       : "utf-8"



                    },
                 action = opts.sandbox ?  "https://www.sandbox.paypal.com/cgi-bin/webscr"  : "https://www.paypal.com/cgi-bin/webscr",  method = opts.method === "GET" ? "GET" : "POST"   ; </i>

我正在尝试使用form.target = "_blank"; target = "_blank" 但没有,

演示: https://e70f9b946472493e61425bd76235c6dfd3f4593d.googledrive.com/host/0B87ueB-BviwSUDgydXRxWi16OGM/#/

谁能帮忙!

【问题讨论】:

    标签: javascript jquery paypal checkout


    【解决方案1】:

    试试

    form.attr('target', '_blank');
    

    【讨论】:

      猜你喜欢
      • 2021-06-27
      • 2017-12-28
      • 1970-01-01
      • 2014-03-24
      • 2012-02-28
      • 2011-12-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多