function showPrice(data) //pass the data as an object literal instead of a string
{
var $remaining = $('#remaining');
$remaining.empty();
$.ajax({
url: 'getevent.php',
data: data,
success: function(reponse){
$remaining.html(reponse);
}
});
}
$('#events').change(function(){
var pluspoint=$('#events').val();
var data = { q : 1};
showPrice(data);
});
我正在尝试将变量 q 传递给 php 文件并取回结果。我得到了结果,但我得到一个错误参数 q is undefined 。