$.ajax({
url : 'http://21.203.1.47/gjs/example.php?id=va',//需要提交的Url地址 默认get方式 //就是这行
async : true,//默认设置下,所有请求均为异步请求
cache : false, //设置为 false 将不会从浏览器缓存中加载请求信息。
dataType : 'text',//数据类型
//错误回调函数
error : function(xhr) {
alert('错误:' + xhr.responseText);
},
success : function(data) {
//成功获取数据后回调函数
alert('正确:'+va);//
$('#textfield2').val(data);
url : 'http://21.203.1.47/gjs/example.php?id=va',//需要提交的Url地址 默认get方式 //就是这行
async : true,//默认设置下,所有请求均为异步请求
cache : false, //设置为 false 将不会从浏览器缓存中加载请求信息。
dataType : 'text',//数据类型
//错误回调函数
error : function(xhr) {
alert('错误:' + xhr.responseText);
},
success : function(data) {
//成功获取数据后回调函数
alert('正确:'+va);//
$('#textfield2').val(data);
}
url传多参方式:
function callserver(number_id,good_bad){ var url = "comment_ajax.asp?id="+number_id+"&vote_number="+good_bad; }