M
Montadar
Guest
I am having trouble to get Swal function works. I am trying to use a nice looking pop message window by using Swal bootstrap instead of alert but it didn't work. Can someone please tell me what is going on. Here is the code:
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<link href="/Content/cssnew/ie10-viewport-bug-workaround.css" rel="stylesheet">
<link href="~/bootstrap-3.3.6-dist/css/bootstrap.min.css" rel="stylesheet" />
<script src="~/bootstrap-3.3.6-dist/js/bootstrap.js"></script>
<script src="https://lipis.github.io/bootstrap-sweetalert/lib/sweet-alert.js"></script>
<link href="~/Content/sweetalert/sweet-alert.css" rel="stylesheet" />
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<link href="/Content/cssnew/font-awesome.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<!-- Custom styles for this template -->
<link rel="stylesheet" href="/Content/cssnew/owl.carousel.min.css">
<link rel="stylesheet" href="/Content/cssnew/owl.theme.default.min.css">
<link href="/Content/cssnew/style.css" rel="stylesheet">
$('#btnSend').click(function () {
$.blockUI({ message: '<p style="margin-top:8px !important; margin-bottom:8px !important;"><img src="/images/loading.gif" /> Loading...</p>' });
$.ajax({
type: 'POST',
url: '@Url.Action("SaveContactUsDetail", "ContactUs")',
data: { email: $('#txtEmail').val(), Name: $('#txtName').val(), Message: $('#txtMessage').val() },
success: function (data) {
$('#txtEmail').val("");
$('#txtName').val("");
$('#txtMessage').val("");
alert('We will contact you as soon as possible.');
$.unblockUI();
},
error: function (ex) {
//Window
swal("Internal server error !");
// End window
// alert('Internal server error.');
//$.unblockUI();
//alert({ message:'<div id="dialog-message" title="Download complete"> <p> <span class="ui-icon ui-icon-circle-check" style="float:left; margin:0 7px 50px 0;"></span> Your files have downloaded successfully into the My Downloads folder. </p> <p> Currently using <b>36% of your storage space</b>. </p> </div>' });
$.unblockUI();
}
});
});
});
Montadar
Continue reading...
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<link href="/Content/cssnew/ie10-viewport-bug-workaround.css" rel="stylesheet">
<link href="~/bootstrap-3.3.6-dist/css/bootstrap.min.css" rel="stylesheet" />
<script src="~/bootstrap-3.3.6-dist/js/bootstrap.js"></script>
<script src="https://lipis.github.io/bootstrap-sweetalert/lib/sweet-alert.js"></script>
<link href="~/Content/sweetalert/sweet-alert.css" rel="stylesheet" />
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<link href="/Content/cssnew/font-awesome.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<!-- Custom styles for this template -->
<link rel="stylesheet" href="/Content/cssnew/owl.carousel.min.css">
<link rel="stylesheet" href="/Content/cssnew/owl.theme.default.min.css">
<link href="/Content/cssnew/style.css" rel="stylesheet">
$('#btnSend').click(function () {
$.blockUI({ message: '<p style="margin-top:8px !important; margin-bottom:8px !important;"><img src="/images/loading.gif" /> Loading...</p>' });
$.ajax({
type: 'POST',
url: '@Url.Action("SaveContactUsDetail", "ContactUs")',
data: { email: $('#txtEmail').val(), Name: $('#txtName').val(), Message: $('#txtMessage').val() },
success: function (data) {
$('#txtEmail').val("");
$('#txtName').val("");
$('#txtMessage').val("");
alert('We will contact you as soon as possible.');
$.unblockUI();
},
error: function (ex) {
//Window
swal("Internal server error !");
// End window
// alert('Internal server error.');
//$.unblockUI();
//alert({ message:'<div id="dialog-message" title="Download complete"> <p> <span class="ui-icon ui-icon-circle-check" style="float:left; margin:0 7px 50px 0;"></span> Your files have downloaded successfully into the My Downloads folder. </p> <p> Currently using <b>36% of your storage space</b>. </p> </div>' });
$.unblockUI();
}
});
});
});
Montadar
Continue reading...