注:时间有点忙,直接copy 过来的,要查看原址: http://www.developer.com/net/dealing-with-json-dates-in-asp.net-mvc.html Introduction Most of the time, data transfer during Ajax communication is facilitated using JSON format. While JSON format is text based, lightweight a
Spring 中配置扫描器 <!-- springmvc的扫描器--> <context:component-scan base-package="com.beifeng.servlet"/> 建立Controller 类 @Controller @RequestMapping(value="/sys/") public class RegController { @RequestMapping(value="reg.do"
在asp.net mvc后台返回到视图中的json数据中想对数据进行操作,发现日期类型无法直接进行操作,需要转换为指定格式才行.在网上也搜了下方法也很多,觉得有点麻烦,最终使用正则搞定了,分享下: var jsondate="/Date(1415169703000)/"; var formatdate=eval(jsondate.replace(/\/Date\((\d+)\)\//gi, "new Date($1)")); alert(formatdate.toL