日期:2014-05-16  浏览次数:20364 次

JS字符串和json转换

?

	<head>
		<script src="jquery-1.8.0.min.js" type="text/javascript"></script>
		<script src="jquery.json-2.4.js" type="text/javascript"></script>
	</head>


var str = {
						ApiName: 'sc.ps.getHouseIdentityByDigitalCode',
				    AppKey: 'EFB4A705E64DF0289C6EB1E330A93149',
				    AppSecret: 'F593701D226604AF31FC263FD82A2A68',
				    AppSession: "null",
				    Parmeters: ["10188001300010780"]	
				};

var jsonStr = $.toJSON(str);
				
var name = $.evalJSON( jsonStr ).ApiName;
alert(name);

?

?