ASP 获取JSON的值

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

<script language="javascript" runat="server" src="json2.min.asp"></script>
<script language="vbscript" runat="server">
   Option Explicit
   
   Dim car: Set car = JSON.parse("{""brand"":""subaru"",""model"":""outback sport"",""year"":2003," & _
                                 """colour"":""green"",""accessories"":[" & _
                                 "{""foglamps"":true},{""abs"":true},{""heatedSeats"":true}]}")
                                 
   Response.Write("brand: " & car.brand & "<br/>")                               
   Response.Write("model: " & car.model & "<br/>")                               
   Response.Write("colour: " & car.colour & "<br/>")                               
   Response.Write("has foglamps: " & CStr(car.accessories.get(0).foglamps) & "<br/>")                               
   car.accessories.get(0).foglamps = false
   Response.Write("has foglamps: " & CStr(car.accessories.get(0).foglamps) & "<br/>")                               
   Response.Write("new Json: " & JSON.stringify(car) & "<br/>")
   
   Set car = Nothing
</script>