I am currently working on an AJAX call in MVC3 and here is the snippet of code I have:
save: function () {
$.ajax({
url: "@Url.Action("Save")",
type:"post",
data: ko.toJSON(this),
contentType:"application/json",
success: function(result){alert(result.message)}
});
}
The issue arises with this particular line:
success: function(result){alert(result.message)}
I am looking to streamline things by passing all the necessary details through a HtmlHelper. However, the success line is causing a roadblock. Is there a way for me to specify a separate function for that line like so:
success: doSomeStuff(result)
and define the function as follows:
function doSomeStuff(result){alert(result.message)}
Thank you in advance!