jquery cs
var url = BASE_PATH + "/viewTool/getDateStr.action"; $.ajax({ url: url, async: false, // 注意此处需要同步,因为返回完数据后 type: "POST", dataType: "json", success: function (data) { if (data.result == "OK") { curTime = data.value; } } });
----
js hashtable
function HashTable() { var size = 0; var entry = new Object(); this.add = function (key, value) { if (!this.containsKey(key)) { size++; } entry[key] = value; }; this.getValue = function (key) { return this.containsKey(key) ? entry[key] : null; }; this.remove = function (key) { if (this.containsKey(key) && ( delete entry[key] )) { size--; } }; this.containsKey = function (key) { return (key in entry); }; this.containsValue = function (value) { for (var prop in entry) { if (entry[prop] == value) { return true; } } return false; }; this.getValues = function () { var values = new Array(); for (var prop in entry) { values.push(entry[prop]); } return values; }; this.getKeys = function () { var keys = new Array(); for (var prop in entry) { keys.push(prop); } return keys; }; this.getSize = function () { return size; }; this.clear = function () { size = 0; entry = new Object(); }; }----
js 格式化时间日期
Date.prototype.Format = function (fmt) { //author: meizz var o = { "M+": this.getMonth() + 1, //月份 "d+": this.getDate(), //日 "h+": this.getHours(), //小时 "m+": this.getMinutes(), //分 "s+": this.getSeconds(), //秒 "q+": Math.floor((this.getMonth() + 3) / 3), //季度 "S": this.getMilliseconds() //毫秒 }; if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)); for (var k in o) if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); return fmt; }; var curTime = new Date(); curTime = curTime.Format("yyyy-MM-dd hh:mm:ss");
----
完
相关推荐
HMHYY 2020-07-28
ELEMENTS爱乐小超 2020-07-04
amazingbo 2020-06-28
alicelmx 2020-06-16
minkee 2020-06-09
逍遥友 2020-06-02
嗡汤圆 2020-05-10
whbing 2020-05-05
zhuxianfeng 2020-05-02
assastor 2020-05-01
JessePinkmen 2020-05-01
hongxiangping 2020-04-30
theta = np.zeros #theta = array,构造全为零的行向量。grad[0,j] = np.sum/len #∑term / m. return value > threshol
Kwong 2020-04-26
88483063 2020-04-23
xirongxudlut 2020-04-19