摘要:
<script> function randomColor() { var arr = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"]; var colo 阅读全文
摘要:
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title> <style> .wrapper{ margin: 50px 0 0 500px; } .doraemon{ position: 阅读全文
摘要:
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title> <style> *{ margin: 0; padding: 0; list-style: none; } .wrap{ widt 阅读全文
摘要:
<!DOCTYPE html><html lang="en"> <head> <meta charset="UTF-8"> <title>boke</title> <style> table { width: 800px; height: 300px; border-collapse: collap 阅读全文
摘要:
<script> var url = "baidu.com?"; //var url = window.location.search; //获取url function getUrl(url) { var obj = {}, arr = [], temp = []; arr = url.split 阅读全文
摘要:
<script> var supportsOrientationChange = "onorientationchange" in window, orientationEvent = supportsOrientationChange ? "orientationchange" : "resize 阅读全文
摘要:
<script> function isEach(arr, callback) { for (var i in arr) { callback(i, arr[i]); } }; function each(arr) { isEach(arr, function(k, v) { console.log 阅读全文
摘要:
<script> function inArray(val, arr) { for (var i = 0, len = arr.length; i < len; i++) { if (arr[i] === val) return i; } return -1; } console.log(inArr 阅读全文
摘要:
<script> function trim(str) { return str.replace(/(^\s*|\s*$)/g, "") } console.log(trim(" 256 ")); console.log(" 123 ".trim()); /* JS str.trim(); JQ $ 阅读全文
摘要:
<script> function sort(arr) { return arr.sort(function(a, b) { return a > b; }) }; console.log(sort([1, 3, 8, 9, 6, 2, 4])); </script> 阅读全文
摘要:
<script> function timer() { setInterval(function() { var date = new Date(), y = date.toLocaleDateString().split("/"), h = date.toLocaleTimeString().su 阅读全文
摘要:
<script> function subArr(a, b) { return a.filter(function(i) { return b.indexOf(i) == -1 }) } console.log(subArr([1,2,3,4],[3,4,5])); </script> 阅读全文
摘要:
<script> function changeFormat(str) { return str.replace(/-(\w)/g, function(k, r) { return r.toUpperCase() }) }; console.log(changeFormat("font-size") 阅读全文
摘要:
<script> function subArr(a, b) { return a.filter(function(i) { return b.indexOf(i) !== -1 }) }; console.log(subArr([1, 2, 3, 4], [3, 4, 5])); </script 阅读全文
摘要:
<script> function subArr(arr) { var obj = {}; return arr.filter(function(n) { return obj[n] ? false : (obj[n] = true) }) } console.log(subArr([1, 2, 3 阅读全文