可能是应该返回内容带了标签,过滤下 var index=data.indexOf("<"); if (index!=-1){ data=data.substring(0,index); } 这样就可以了 var index=data.indexOf("<audio");if (index!=-1){ data=data.substring(0,index);}…
当ASP.NET后台使用JavaScriptSerializer这个组件将对象序列化为json,或者使用ScriptMethod特性的json [ScriptMethod(ResponseFormat = ResponseFormat.Json), WebMethod(EnableSession = true)] public List<EUser> Users()//参数测试用 { List<EUser> l = new List<EUser>(); Random a…
在asp.net mvc后台返回到视图中的json数据中想对数据进行操作,发现日期类型无法直接进行操作,需要转换为指定格式才行.在网上也搜了下方法也很多,觉得有点麻烦,最终使用正则搞定了,分享下: var jsondate="/Date(1415169703000)/"; var formatdate=eval(jsondate.replace(/\/Date\((\d+)\)\//gi, "new Date($1)")); alert(formatdate.toL…