JavaScrpit
li_shihao
这个作者很懒,什么都没留下…
展开
-
js获取系统时间
//获取系统时间 var nowTime = new Date(); var snowTime = nowTime.format("yyyy-MM-dd"); //用于js获取日期后格式化使用Date.prototype.format = function(format){ var o = { "M+" : this.getMonth()+1, //month...原创 2013-06-18 09:50:43 · 49 阅读 · 0 评论 -
遍历JavaScript某个对象所有的属性名称和值的方法
function allPrpos(obj) { // 用来保存所有的属性名称和值 var props = ""; // 开始遍历 for(var p in obj){ // 方法 if(typeof(obj[p])=="function"){ obj[p](); ...原创 2013-06-08 14:45:06 · 385 阅读 · 0 评论 -
javascript 保留小数点后N为
// 保留小数点后N位function roundNumber(number,decimals) { var newString;// The new rounded number decimals = Number(decimals); if (decimals < 1) { newString = (Math.round(number)).toString();...原创 2013-06-21 09:51:40 · 55 阅读 · 0 评论