I'm currently working on a code where I need to display a div before making an ajax request and then hide it once the request is completed. For some reason, the show() function isn't working properly, although the hide() function works fine. This issue seems to only occur in browsers like Firefox.
$("#btnpst").click(function () {
$('#dvloading').show();
$.ajax({
url: url,
type: "POST",
async: false,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data, st) {
if (st == "success") {
$('#dvloading').hide();
}
},
error: function () {
$('#dvloading').hide();
}
});
});
HTML
<div id="dvloading" style="width: 480px; height: 320px; position: absolute; overflow: hidden;">
<image src="../loading_2.gif" style="margin-top: 120px;">
</div>