【问题标题】:Paypal button not working on mobile websitePaypal 按钮在移动网站上不起作用
【发布时间】:2012-08-27 20:27:46
【问题描述】:

我正在使用 Paypal 在网站上接受付款。它在全尺寸网站上运行良好,但是当我在运行 jQuery mobile 的移动版网站上实现相同的代码时,“添加到购物车”按钮不起作用。

我使用的是网站支付标准,所以它不像在这篇文章中添加“-mobile”那么简单:Paypal Checkout in mobile website

Paypal 说页面应该自动重定向,但它没有。

我的按钮也没有正确显示,这很奇怪。在我的笔记本电脑上(在移动网站上),按钮被奇怪地拉伸了,在我的手机上(在移动网站上),按钮看起来也很奇怪。

这是我的 Paypal 按钮代码:

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="ZQK9WXTYG3SDN">
<table>
<tr><td><input type="hidden" name="on0" value="Weekend Ticket Type">Weekend Ticket Type</td></tr><tr><td><select name="os0">
<option value="Full Price Weekend Ticket">Full Price Weekend Ticket £42.00 GBP</option>
<option value="Weekend Concession Ticket">Weekend Concession Ticket £40.00 GBP</option>
<option value="Under 12 Weekend Ticket">Under 12 Weekend Ticket £0.00 GBP</option>
</select> </td></tr>
</table>
<input type="hidden" name="currency_code" value="GBP">
<input style="padding:20px 0px 0px 0px;" width="120" type="image" src="http://www.website-domain.com/images/PayPal-button.jpg" border="0" name="submit" alt="PayPal — The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>

(我已更改网站域名以阻止其在搜索引擎中被收录;-)

非常感谢您的帮助

【问题讨论】:

    标签: mobile paypal standards payment


    【解决方案1】:

    我建议 jQuery Mobile 正在劫持您的表单提交(就像使用 &lt;a href=".."&gt; 标签一样)。 尝试将data-ajax="false"添加到您的&lt;form&gt;标签。

    您可以在此处找到有关此行为的更多信息: http://jquerymobile.com/test/docs/forms/forms-sample.html

    或者通过将此 sn-p 添加到您的代码中来全局禁用它:

    $(document).bind("mobileinit", function(){
      $.mobile.ajaxEnabled = false;
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-08
      • 2017-07-08
      • 1970-01-01
      • 1970-01-01
      • 2022-01-16
      • 1970-01-01
      相关资源
      最近更新 更多