当我们使用$_REQUEST
inPHP
接收 post/get 值时,我正在寻找一个类似的函数/键来接收values
通过$.ajax
.. in java script
/j query
例子:
<script>
function do_something(){
// here i want the value sent using ajax
return term;
}
$('#input').keyup(function(){
var term=$(this).val();
$.ajax({
url:do_something(),// << is this possible?? or should i try
//url:do_something(term) //<< this???
dataType:'json',
data:{term:term},
results:function(data){
alert(JSON.stringify(data));
}
});
</script>