jquery字符串转数组如何把字符串"123,abc,xy,hi"转换成数组或者jQuery数组var arr = '123,abc,xy,hi'.split(','); for(var i in arr){ alert(arr[i]) } 如何把字符串"123-abc-xy-hi"转换成数组或者jQuery数组var arr = '123,abc,xy,hi'.spl...
<script> var a = [1,2,2,3,4,5,6,7,8,9,10,11,12,13,14,15]; var b = a.slice(0,10); alert(b); </script>
javascript转换字母大小写偶尔遇到一些需求,要把客户输入的表单内容转换成大/小写。在此简单记下转换成大写:toUpperCase()转换成小写:toLowerCase()var test = "aBcD"; test = test.toUpperCase(); console.log(test ); //输出为ABCD
<p class="time"> <span id="time" class="red">3</span>s后自动跳转 </p> <script language="javascript" type="text/javascript"...
<input type="text" id="searchAll" value="" onkeydown="keyDown(event)" placeholder="搜索节目" onfocus="if (this.value == '搜索节目' || this.value =...
time=new Date().getHours()+":"+new Date().getMinutes()+":"+new Date().getSeconds(); alert(time);
function addZero(num){ if(num<10){ num="0"+num; } return num; } alert(addZero(8));
//秒换算成时分秒的形式 Number.prototype.formatTime=function(){ // 计算 var h=0,i=0,s=parseInt(this); if(s>60){ i=parseInt(s/60); s=parseInt(s%60); if(i > 60) { ...
//时间戳转格式 function timeStyle(inputTime) { var date = new Date(inputTime); var y = date.getFullYear(); var m = date.getMonth() + 1; m = m < 10 ? ('0' + m) : m; ...
// 判断是否是微信中的浏览器 var ua = navigator.userAgent.toLowerCase(); if (ua.match(/MicroMessenger/i) == "micromessenger") {} else { $(".m-wxdown-tip,.m-qqdown-tip&q...