2016年8月16日

[转]js中的字符串函数集和代码片段

摘要: JS自带函数 concat将两个或多个字符的文本组合起来,返回一个新的字符串。var a = "hello";var b = ",world";var c = a.concat(b);alert(c);//c = "hello,world" indexOf返回字符串中一个子串第一处出现的索引(从左到 阅读全文

posted @ 2016-08-16 13:34 skysowe 阅读(634) 评论(0) 推荐(0)

[转]js中获取时间的函数集

摘要: 获取JavaScript 的时间使用内置的Date函数完成 var mydate = new Date();mydate.getYear(); //获取当前年份(2位)mydate.getFullYear(); //获取完整的年份(4位,1970-????)mydate.getMonth(); // 阅读全文

posted @ 2016-08-16 13:19 skysowe 阅读(23220) 评论(0) 推荐(0)

导航