1.简单的post请求案例
$.post(rootPath+"/jasframework/loginLog/getStatisticsInfoByUserId.do",function(result){ if(result!=null){ var obj = JSON.parse(result); //解析返回值 var name = obj.userName; $("#users").html(name); } });
2.post请求方式2
1 var url = rootPath+‘/jasframework/ycsy/deletsoloution.do‘; 2 $.post( url , 3 {‘eventid‘:rows[0].eventid}, 4 function(result){ 5 if (result.result) { 6 $.messager.alert(getLanguageValue("提示"),"删除成功!",‘info‘); 7 $("#lablemange").datagrid(‘load‘); //重新加载 8 } else { 9 $.messager.alert(getLanguageValue("error"),"删除失败!", ‘info‘); 10 return; 11 } 12 } 13 ,‘json‘); 14 } 15 });
时间: 2024-11-05 13:58:27