javascript 查看 json 字符串内容

  //检查输入的地址是不是有效
	  function checkAddress() {
		//alert("查询数据");
		var centryAddr = $("#centryAddr").val();
			var url = "/crowd/checkAddress";
			$.ajax({
				url:url,
				data:{centryAddr:centryAddr},
				type:'GET',
				dataType:'json',
				async:true,
				success: function(result){
					if(result.stat == "true") {
						alert(JSON.stringify(result));// 调用 JSON.stringify(result) 显示 JSON 内容
						alert("查询成功!");
						$("#xPostition").val(result.xPostition);
						$("#yPostition").val(result.yPostition);
					} else {
						alert("查询失败!");
					}
				},error:function(){
					alert("error");
				}
			});
	  }


你可能感兴趣的:(1_java,基础)