通过jquery ajax的几种方式

1此时的data是html片段

functionshowDimAttr(dimDefId,dimDefName){

varurlStr="/iap/index!showDimAttrValue.action?flag=showDimAttrValue";

$.ajax({

url:urlStr,

type:'POST',

data:{

"dimDefId":dimDefId

},

success:function(data){

//window.alert(data);

//window.alert(data);

$("#showDimAttrValue").html(data);

}

});

$("#useDimDefId").val(dimDefId);

$("#useDimDefName").val(dimDefName);

}

2$.ajax()方式交互

$.ajax({

url:"<%=rootPath%>/index!updateIndexDimAttr.action",

type:"post",

data:{

"indexDimPO.dimDefId":dimDefId,

"indexDimPO.dimId":dimId,

"indexDimPO.dimCode":dimCode,

"indexDimPO.dimName":dimName,

"indexDimPO.dimFieldVal":dimFieldVal

},

dataType:"json",

success:function(data){

//alert("data[0].result"+data[0].result);

varresult=data[0].result;

if(result==1){

alert("修改维度属性成功!");

//返回维度管理页面

window.location.href="<%=rootPath%>/iap/index!getAllDim.action";

}else{

alert("修改维度属性失败!");

}

}

});

相关推荐