We are calling a webservice in jquery ajax. The retu type of webservice is json.
If the webservice is down, we get CONNECTION REFUSED error in the fail method and the MVC C# page reloads again. Since we have written the method in document.ready, the page continuously reloads after calling the webservice.
Please suggest us why there is page reload if there is an ajax failure. Thanks
var GetWebserviceData = function(url) {
var ajaxObj = $.ajax({
type: 'GET',
url: url,
cache: false
});
retu ajaxObj;
};
$(document).ready(function() {
GetWebserviceData()
.done(function(response) {
//process success
})
.fail(function(response) {
//process failure
});
});
