文章分类 - JavaScript
摘要:var QM = (function() { var exports = {}; function scrollToBottom(func) { /** * @判断是否滚动到底部 * ...
阅读全文
摘要:浅复制 深复制后两者完全不干预,所以slice,concat等生成的复制,并不能复制到深层的数组或对象,所以silce,concat严格来说仍然算是浅复制。
阅读全文
摘要:#遍历关联数组、对象,用 for in #abandon
阅读全文
摘要:String.prototype.charAt() str.charAt(index) 返回字符串中指定位置的字符。 字符串中的字符从左向右索引,第一个字符的索引值为 0,最后一个字符(假设该字符位于字符串 stringName 中)的索引值为 stringName.length - 1。 如果指定
阅读全文
摘要:Element.scrollHeight //是计量元素内容高度的只读属性, 包括overflow样式属性导致的视图中不可见内容。//没有垂直滚动条的情况下, scrollHeight值与元素视图填充所有内容所需要的最小值clientHeight相同。//包括元素的padding, 但不包括元素的m
阅读全文
摘要:Array.prototype.splice()array.splice(start, deleteCount[, item1[, item2[, ...]]]) 只有当deleteCount为0时,item1、item2...这些参数才有意义 //用新元素替换旧元素,以此修改数组的内容。 //改变
阅读全文
摘要:Object.create() Object.create(proto, [ propertiesObject ]) Object.create() 方法创建一个拥有指定原型和若干个指定属性的对象。 #似乎是更纯净的object #使用Object.create实现类式继承 # Object.pro
阅读全文
摘要:# 1 //按列访问 2 var grades = [ 3 [89, 77, 78], 4 [76, 82, 81], 5 [91, 94, 89] 6 ]; 7 var total = 0; 8 var average = 0.0; 9 for (var row = 0; row < grades
阅读全文
摘要:排序 sort() 最好在sort()使用使用函数判断,不然遇到相同值时,排序会出错
阅读全文
摘要://window.location function parseURL(url) { var a = document.createElement('a'); a.href = url; return { source: url, protocol: a.protocol.replace(':','
阅读全文
浙公网安备 33010602011771号