this is possible using the jQuery $.ajax() method
$.ajax(serverUrl, { type: OutageViewModel.Id() == 0 ? "POST" : "PUT", data: dataToSave, statusCode: { 200: function (response) { alert('1'); AfterSavedAll(); }, 201: function (response) { alert('1'); AfterSavedAll(); }, 400: function (response) { alert('1'); bootbox.alert('<span style="color:Red;">Error While Saving Outage Entry Please Check</span>', function () { }); }, 404: function (response) { alert('1'); bootbox.alert('<span style="color:Red;">Error While Saving Outage Entry Please Check</span>', function () { }); } }, success: function () { alert('1'); }, });
Ravi Mittal Sep 27 '12 at 17:31 2012-09-27 17:31
source share