I'm having trouble returning data from a php page.
test = function(data){
alert(data);
}
newContent = function(var1){
$.ajax({
url: 'path/to/item.php&var1='+var1,
success: function(data){
test(data);
}
});
}
Which should return "Success" via echo 'Success!';
on the item.php
page.
Why is it returning undefined?