摘要:
1 /* 2 3 Cross-Browser XMLHttpRequest v1.2 4 5 6 Emulate Gecko 'XMLHttpRequest()' functionality in IE and Opera. Opera requires 7 the Sun Java Runtime 阅读全文
posted @ 2020-06-11 11:53
xlsdg
阅读(68)
评论(0)
推荐(0)
摘要:
1 <html> 2 3 <head> 4 <meta charset="utf-8"/> 5 <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1. 阅读全文
posted @ 2020-06-11 11:51
xlsdg
阅读(56)
评论(0)
推荐(0)
摘要:
1 function procScroll(selector, xPercent, xCallback, yPercent, yCallback) { 2 var _isType = function(obj, type) { 3 return Object.prototype.toString.c 阅读全文
posted @ 2020-06-11 11:47
xlsdg
阅读(103)
评论(0)
推荐(0)
摘要:
1 var delayRun = function(fn, interval) { 2 var timer = null; 3 return function() { 4 var that = this; 5 var args = Array.prototype.slice(arguments, 0 阅读全文
posted @ 2020-06-11 11:44
xlsdg
阅读(80)
评论(0)
推荐(0)
摘要:
1 var fnCurry = function(fn) { 2 var _slice = Array.prototype.slice, 3 _args = slice.call(arguments, 1); 4 return function() { 5 return fn.apply(this, 阅读全文
posted @ 2020-06-11 11:42
xlsdg
阅读(199)
评论(0)
推荐(0)
摘要:
1 var getSingleInstance = function(fn) { 2 var _instance = null; 3 return function() { 4 return _instance || (_instance = fn.apply(this, arguments)); 阅读全文
posted @ 2020-06-11 11:40
xlsdg
阅读(48)
评论(0)
推荐(0)
摘要:
1 var first_script = document.getElementsByTagName('script')[0]; 2 first_script.parentNode.insertBefore(script, first_script); 3 4 // script 就是脚本元素。 阅读全文
posted @ 2020-06-11 11:37
xlsdg
阅读(47)
评论(0)
推荐(0)
摘要:
1 //计算字符串长度(英文占1个字符,中文汉字占2个字符) 2 //方法一: 3 String.prototype.gblen = function() { 4 var len = 0; 5 for (var i = 0; i < this.length; i++) { 6 if (this.ch 阅读全文
posted @ 2020-06-11 11:34
xlsdg
阅读(503)
评论(0)
推荐(0)
摘要:
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)
摘要:
1 function imgReporter(url) { 2 var _log = window['_imgLog'] || (window['_imgLog'] = {}), 3 _unique = (function() { 4 var time = (new Date()).getTime( 阅读全文
posted @ 2020-06-11 11:13
xlsdg
阅读(476)
评论(0)
推荐(0)
摘要:
1 var $body = $('body'); 2 3 document.title = 'the title you want to set'; 4 5 var $iframe = $("<iframe style='display:none;' src='/favicon.ico'></ifr 阅读全文
posted @ 2020-06-11 11:12
xlsdg
阅读(126)
评论(0)
推荐(0)