当点击按钮使用swal时,它在桌面浏览器上运行正常。但是当从移动浏览器访问同一页面并提交表单时,它只是给出了一个空白的白页。
<form name="test" action="test.php" id="reviewForm">
<div class="row">
<div class="form-group">
<div class="col-md-5 col-sm-12 col-xs-12">
<input type="button" class="btn btn-success" id='reviewSubmit' value="Submit Your Review"/>
</div>
</div>
</div>
</form>
$(document).ready(function () {
$("#reviewSubmit").on ('click',function (e) {
var esc_review=escapeHtml($("#review").val());
var input = $("<input>")
.attr("type", "hidden")
.attr("name", "review1").val(esc_review);
$('#reviewForm').append($(input));
swal({
title: 'Are you sure you want to submit this review?',
text: "This review will be submitted "
+ "and once approved will be displayed in the website ",
type: 'warning',
showCancelButton: true,
confirmButtonText: 'Submit',
cancelButtonText: 'Cancel',
confirmButtonClass: 'btn btn-success',
cancelButtonClass: 'btn btn-danger',
showLoaderOnConfirm: true,
preConfirm: function () {
return new Promise(function (resolve) {
$('#reviewForm').submit();
});
},
allowOutsideClick: false
});
});