摘要: 不用算法的答案是: var a=[1,2,3,5……]; alert(Math.max.apply(null, a));//最大值 alert(Math.min.apply(null, a));//最小值 用选择排序法: function findmax(str){ var max=str[0]; for(var i=1;istr.length;i++){ if(maxstr[i]){ max=str[i]; } } return max; } 阅读全文
posted @ 2013-09-28 19:57 卡可美 阅读(730) 评论(0) 推荐(0)
摘要: 下面列出IE和非IE中常见的一些js兼容性问题。 //window.event IE:有window.event对象 非IE:没有window.event对象。可以通过给函数的参数传递event对象。如onmousemove=doMouseMove(event) 解除冒泡的方法不同 阅读全文
posted @ 2013-09-28 13:45 卡可美 阅读(1828) 评论(0) 推荐(0)