您的位置:首页 > Web前端 > JavaScript

ajax请求(二),后台返回的JSon字符串的转换

2015-04-17 17:18 211 查看
ajax请求,json的转换

$.ajax({
url : "../folder/isExistAddFolder.do?t="+new Date(),
type : 'POST',
data:{"foldername":foldername,
"parentid":parentid,
"foldertype":foldertype
},
success : function(result){
if(result==true){
$('#addfolderfrom').form('submit', {
url : urls,
onSubmit : function() {
return $(this).form('validate');
},
success : function(data) {
//                                alert(JSON.stringify(data));
var result = eval('(' + data + ')');
if (result.error) {
top.showAlert('提示',result.msg , 'info');
} else {
reloadDatas('queryFolder.htm', 'projectfenlei',parentid,4);
reloadData('PorjectInfo', 'projectInfo');
closeUnit();
//                                    }
}
}
});
}else{
top.showAlert('提示', '项目名称已存在', 'info');
}
},
dataType:"json",
error : function(result) {
}
});
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: