I have a form:
<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>
and a function 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;
}
The problem is that on a new ipad (Safari) CreateOrder
action is not called. On the desktop browser, it works fine. There are no errors in console. I tried to add an alert after:
success: function (response) {
like that:
success: function (response) {
alert(response.IsSuccess)
and alert
return me true
. Why? if CreateOrder
is not called. I also added logging to CreateOrder
action and there are no output strings.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…