01 2016 档案

摘要:首先写游戏的时候,JSON字符串转成OBJECT的时候,希望做个数组随机排序的方法如下: //用Math.random()函数生成0~1之间的随机数与0.5比较,返回-1或1 function randomsort(a, b) { return Math.random()>.5 ? -1 : 1; 阅读全文
posted @ 2016-01-08 10:21 霏霏雪无声 阅读(777) 评论(0) 推荐(0)
摘要:Date.prototype.Format = function(fmt) { var o = { "M+" : this.getMonth()+1, //月份 "d+" : this.getDate(), //日 "h+" : this.getHours(), //小时 "m+" : this.g 阅读全文
posted @ 2016-01-07 17:10 霏霏雪无声 阅读(232) 评论(0) 推荐(0)