I have this JQuery code shows the results for a split second and disappear. What I am doing wrong?
$(function () {$("#main_rent_btn").click(function () {$.ajax({
url: '/Home/GetRent',
contentType: 'application/html; charset=utf-8',
type: 'GET',
dataType: 'html',
cache: false,
beforeSend: function () {$('#loading').show();
}
})
.success(function (result) {$("#rent_results").html(result);$('#loading').hide();
}).
error(function (xhr, status) {
alert(status);
})
});
});