My question regards the $.ajax()
jQuery method. I can't get the success parameter in $.ajax()
to work.
This works:
$.ajax({
type: 'POST',
url: "/getCodes.php?codes=billingCodes&parent="+$('#wClient').val(),
dataType: 'json',
success: window.alert("inside aJax statement")
});
This does not:
$.ajax({
type: 'POST',
url: "/getCodes.php?codes=billingCodes&parent="+$('#wClient').val(),
dataType: 'json',
success: function(){
window.alert("inside aJax statement");
}
});
In the first case, I get a JavaScript alert window that lets me know the $.ajax()
I called is working. All that is changed in the second block of code is I put the window.alert()
inside a function() { window.alert(); }
.
The point of this is to verify that the $.ajax is running so I can put some actual useful code in the function(){}
when the $.ajax runs successfully.