摘要:
1 /* requestAnimationFrame.js 2 * by zhangxinxu 2013-09-30 3 */ 4 (function() { 5 var lastTime = 0; 6 var vendors = ['webkit', 'moz', 'ms', 'o']; 7 fo 阅读全文
posted @ 2020-06-11 11:31
xlsdg
阅读(37)
评论(0)
推荐(0)
摘要:
1 var hasOwnProperty = Object.prototype.hasOwnProperty 2 /** 3 * Check whether the object has the property. 4 * 5 * @param {Object} obj 6 * @param {St 阅读全文
posted @ 2020-06-11 11:29
xlsdg
阅读(49)
评论(0)
推荐(0)
摘要:
1 function isPromise(obj) { 2 return !!obj && (typeof obj 'object' || typeof obj 'function') && typeof obj.then 'function'; 3 } 阅读全文
posted @ 2020-06-11 11:26
xlsdg
阅读(228)
评论(0)
推荐(0)
摘要:
1 // 通用的Http 2 app.factory('servHttp', ['$http', function($http) { 3 return { 4 get: (url, data) = > { 5 return $http.get(url, { 6 params: data, 7 cac 阅读全文
posted @ 2020-06-11 11:23
xlsdg
阅读(108)
评论(0)
推荐(0)
摘要:
1 var rand = (function() { 2 var seed = (new Date()).getTime(); 3 4 function r() { 5 seed = (seed * 9301 + 49297) % 233280; 6 return seed / (233280.0) 阅读全文
posted @ 2020-06-11 11:22
xlsdg
阅读(159)
评论(0)
推荐(0)
摘要:
1 function length4UTF8String(s) { 2 var total = 0; 3 var charCode = null; 4 for (var i = 0, len = s.length; i < len; i++) { 5 charCode = s.charCodeAt( 阅读全文
posted @ 2020-06-11 11:20
xlsdg
阅读(128)
评论(0)
推荐(0)
摘要:
1 //组合 2 3 function C(arr, num) { 4 var r = []; 5 (function f(t, a, n) { 6 if (n 0) { 7 return r.push(t); 8 } 9 for (var i = 0, l = a.length; i <= l - 阅读全文
posted @ 2020-06-11 11:18
xlsdg
阅读(124)
评论(0)
推荐(0)
摘要:
1 /*! 2 * contentloaded.js 3 * 4 * Author: Diego Perini (diego.perini at gmail.com) 5 * Summary: cross-browser wrapper for DOMContentLoaded 6 * Update 阅读全文
posted @ 2020-06-11 11:17
xlsdg
阅读(132)
评论(0)
推荐(0)
摘要:
1 <script> 2 document.addEventListener("DOMContentLoaded", function(event) { 3 console.log("DOM fully loaded and parsed"); 4 }); 5 </script> 阅读全文
posted @ 2020-06-11 11:16
xlsdg
阅读(1136)
评论(0)
推荐(0)
摘要:
1 <script src="https://ajax.googleapis.com/ajax/libs/jquery/{{JQUERY_VERSION}}/jquery.min.js"></script> 2 3 <script>window.jQuery || document.write('< 阅读全文
posted @ 2020-06-11 11:14
xlsdg
阅读(199)
评论(0)
推荐(0)