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:
<开发者_StackOverflow中文版;?php
echo 'php file';
print_r($_POST);
?>
Why jquery no run php script? Return full php code:
<?php
echo 'php file';
print_r($_POST);
?>
What is order
param? Callback should go as third parameter: look at documentation. Unless order is the name of function defined elsewhere.
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);
});
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);
});
精彩评论