asp用服务器端js解析并获取简单json示例
<script type="text/javascript" language="javascript" runat="server"> function jsParseJSON(s){ try{return (new Function('return' + s))(); }catch(e){return false}; } function jsGetField(s, fld){ var obj=jsParseJSON(s); return obj===false ? '' : (typeof obj[fld]==='undefined' ? '' : obj[fld]); } </script> <% Response.Write jsGetField("{""err"":0,""msg"":""ok""}", "msg") %>输出结果:ok