I have a problem when I try to send some data with $.post(jquery ajax function)
- it's not working. My code is here:
$.post(
$(this).attr("action"),
{
task: "add",
$(this).serialize()
},
function(data) {
if (data.length > 0 ) {
alert("Success");
}
}
);
I am guessing the problem is with the data being sent, actually I have one complete AJAX page with lots of switch case statements to perform so for that I need to specify the task
variable every time I send and AJAX request.
If there are better solutions on how to solve this issue feel free to share your thoughts. Thank you.