Reputation: 3823
i have jQuery script:
var order = 'user=lolalola';
$.post("ajax.php",{action:"run"}, order, function(data){
alert("Data Loaded: " + data);
$("#dd_message").html(data);
});
and php scitp:
<?php
echo 'php file';
print_r($_POST);
?>
Why jquery no run php script? Return full php code:
<?php
echo 'php file';
print_r($_POST);
?>
Upvotes: 0
Views: 111
Reputation: 227220
All the POST fields should be in 1 parameter.
var order = 'user=lolalola';
$.post("ajax.php",'action=run&'+order, function(data){
alert("Data Loaded: " + data);
$("#dd_message").html(data);
});
Upvotes: 0
Reputation: 4721
you have an extra parameter there. You should be getting a JS error on the browser. try this:
var order = 'user=lolalola';
$.post("ajax.php",{action:"run", user:"lolalola"}, function(data){
alert("Data Loaded: " + data);
$("#dd_message").html(data);
});
Upvotes: 0
Reputation: 8376
What is order
param? Callback should go as third parameter: look at documentation. Unless order is the name of function defined elsewhere.
Upvotes: 1