<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script type="text/javascript">
var jsonObject={
name:"yangyang",
age:24,
address:{city:"beijing",school:"qinghua"},
teaching:function(){alert("Anroid!")}
};
alert(jsonObject.name);
jsonObject.teaching();
var jsonStr="{name:'yy'}";
var jsonStr2="alert('hello')";
var jsonObject=eval("("+jsonStr+")");
var jsonObject2=eval(jsonStr2);
alert(jsonObject.name);
</script>
</head>
<body>
</body>
</html>
json 字符串及解析
最新推荐文章于 2023-07-15 23:26:42 发布