function createQueryString(){
var firstName =
encodeURI(
encodeURI($(#firstName).value));
var query = "firstName="+firstName+"&secondName="+"Lee";
return query;
}
function doRequestUsingGET(){
$.ajax({
type:"GET",
url:"14.html",
data:createQueryString();
success:function(
data){
$("#serverResponse").html(decodeURI(data));
}
})
}
function doRequestUsingPOST(){
$.ajax({
type: "POST",
url: "14-5.aspx",
data: createQueryString(),
success: function(data){
$("#serverResponse").html(decodeURI(data));
}
});
}
function test(varWeight){
//var index = parseFloat(document.activeElement.id);获得当前对象
var index = parseFloat($(varWeight).attr("id"));//获得当前id内容
var fieldNo = document.getElementById("fieldNo")[index].value;
var weight = document.getElementsByName("weight")[index+1].value;
if(fieldNo != "" && weight != ""){
var query = "fieldNo="+fieldNo+"&weight="+weight;
alert(query);
$.ajax({
type: "POST",
url: '${webroot}/suggest!maxCount.do',
// dataType: 'text',
data: query,
success:function(data){
//name1=msg.userName[0].name1;
//close();
//return false;
// document.getElementById(obj).innerHTML=html;
},
error: function(){
// document.getElementById(obj).innerHTML="网络连接超时,无法显示数据!";
// return;
}
});
}
}