var result = selectedDate.toJSON().substring(0,10);
這個方法比較簡單。
但是IE9 以下 並不支持 toJSON 需要引入json2.js,如下所示
<!--[if lt IE 9]>
<script src="json2.js"></script>
<![endif]-->
json2.js的文件地址
https://github.com/douglascrockford/JSON-js
var result = selectedDate.toJSON().substring(0,10);
這個方法比較簡單。
但是IE9 以下 並不支持 toJSON 需要引入json2.js,如下所示
<!--[if lt IE 9]>
<script src="json2.js"></script>
<![endif]-->
https://github.com/douglascrockford/JSON-js