This is my js. It is triggered by a button click and then calls for a web function.
The webfunction works correctly with no errors, but on the js noone of the .done or success or error prompts appear so i cannot debug why in the end it doesnt call the webfunction at all.
function updateTicket(TicketID) {
var strActualEffort = document.getElementById("txtActualEffort").value;
var fltActualEffort;
fltActualEffort = parseFloat(strActualEffort);
if (!isNaN(fltActualEffort)) {
CalculateRisk(fltActualEffort);
jQuery.ajax({
type: "POST",
url: "web function url",
data: { ID: TicketID, Effort: fltActualEffort },
success: function OnSuccess(e) { alert('SUCCESS!' + e); },
error: function OnError(e) { alert('Failed coz : ' + e); },
complete: function OnComplete() { alert('COMPLETE'); }
}).done(function (data) {
alert("success" + data.slice(0, 100));
}).fail(function () {
alert("error");
}).always(function () {
alert("complete");
});
}
}
any ideas?
Issues Fixed.
The ajax wasnt doing anything because using IE the window closed before the actual web method was called.
Solved it by setting the ajax function call as asynch.