java JSON空值和空值在JSON对象中为true
如果我在JSON对象中添加空值或空值,则JSON值为true
$scope.getUserData = function (){
$.ajax({
url: "/test.com/abc.jsp",
type: "POST",
dataType: "json",
data: {
action : "getUserData",
id : Id,
logView:"true",
},
async:false,
success: function(data){
// data is json array and userData is json object
$scope.userData = JSON.parse(data.userData);
$scope.userData.uname // comes as true but from server it is set as blank
});
});
}
在服务器端java代码中,我从数据中获得的值为blank/null,但在JSON对象中,值为true,表示blank/null。它在我的本地环境中工作,但在服务器环境中,对于blank/null则是如此
共 (0) 个答案