我有一个表格:
<form id="orderForm" onsubmit="return prepareOrder(this);" action='@ConfigurationManager.AppSettings["EpaylogonUrl"]' method="POST"> <input type="hidden" name="Signed_Order_B64" value=""> <input type="hidden" name="email" size="50" maxlength="50" value="@Model.Email"> <input type="hidden" name="appendix" value="@Model.AppendixInfo"> <button class="wiz_button" type="submit" disabled="disabled"> <span><span id="buy_button_name">Buy</span></span></button> </form>
和一个功能PrepareOrder
function prepareOrder(form) { var selectedPayWay = $('.pay_cont.selected').data('way'); var result; $.ajax({ type: 'POST',url: '/Pay/CreateOrder',data: { payWay: selectedPayWay },success: function (response) { if (response.IsSuccess) { switch (selectedPayWay) { case payWay.Terminal: showBookingInfo(response.BookingId,response.ExpiredDate); result = false; break; case payWay.Epay: $("input[type=hidden][name=Signed_Order_B64]").val(response.SignedString); $("input[type=hidden][name=appendix]").val(response.AppendixString); result = true; break; } } else { toastr.options.timeOut = 10000; toastr.info(response.Message); result = false; } },error: function () { result = false; },async: false }); return result; }
问题是在新的ipad(Safari)上没有调用CreateOrder操作.在桌面浏览器上,它工作正常.控制台中没有错误.我尝试在以下后添加警报:
success: function (response) {
像那样:
success: function (response) { alert(response.IsSuccess)
和警报回报我是真的.为什么?如果未调用CreateOrder.我还添加了对CreateOrder操作的日志记录,并且没有输出字符串.