Using .click, when I click the button it calls a wrapper function I have in an external js file which does a $.ajax call. If the PUT request was successful, I want to display a message in my current document. My code looks like:
$("input[value='update']").click(function(event) {
......
callMyWS("PUT", url, bodyData) // wrappe has call to $.ajax
$(document).ajaxSuccess(function() {
alert("http request successful!");
});
$(document).ajaxError(funtion() {
alert("http request unsuccessful!");
});
});
In my chrome debugger it enters the event handler for the click but not the ajaxSuccess or ajaxFailure. I've verified in my db that the request was successful and updated the table column value. I am testing this on localhost. This page is being served by apache on its default port and the ajax request in question is being handled by a controller on a different port, but same domain.