swal在移动浏览器上显示空白页面(IOS,Android上的问题)

时间:2017-09-04 09:43:48

标签: jquery sweetalert2

当点击按钮使用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
                });


            });

0 个答案:

没有答案