jQuery .post gets null data
Posted
by Andrew Flusche
on Stack Overflow
See other posts from Stack Overflow
or by Andrew Flusche
Published on 2010-03-21T21:41:11Z
Indexed on
2010/03/22
0:21 UTC
Read the original article
Hit count: 717
jquery-ajax
|php
Hey everyone. This is my first post here, so I hope I'm doing it appropriately.
I have several jQuery $.post calls that work just fine. They send data to a PHP script that modifies a database and returns some data. No problem.
But this one doesn't work. The returned data is just NULL.
$.post("act_addTaskLog.php",
{description: $("#logFormDescription").val(), complete: $("#logFormComplete").is(':checked'), taskId: $("#logFormTaskId").val(), user: <?php echo $_SESSION['user']; ?>},
function(data) {
alert("data: " + data);
}
);
I've tried everything I can think of, to no avail. I've even tried just one line in my PHP script:
die("true");
Firebug shows that the script is being executed, but it's not completing. The alert message displays just with the label "data:" in it, no actual data.
Thanks in advance for your help!
© Stack Overflow or respective owner