上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 15 下一页
摘要: Search 阅读全文
posted @ 2013-12-17 18:03 sexy_girl 阅读(197) 评论(0) 推荐(0) 编辑
摘要: <?php/** * Author: humanhuang * Date: 13-12-17 */header('Access-Control-Allow-Origin:*');header('Access-Control-Request-Method:GET,POST');echo "nice";$.get('http://10.24.66.6/human/www/1/animate/3/ajax.php',function(e){console.log(e);}) 阅读全文
posted @ 2013-12-17 14:28 sexy_girl 阅读(128) 评论(0) 推荐(0) 编辑
摘要: ajax 所有请求都会附带主域的cookie,若没有同源策略,攻击者就可以获取你的cookie,状态。 阅读全文
posted @ 2013-12-17 11:59 sexy_girl 阅读(194) 评论(0) 推荐(0) 编辑
摘要: if (typeof Object.create !== 'function') { Object.create = function (o) { function F() {} F.prototype = o; return new F(); } } 阅读全文
posted @ 2013-12-17 11:39 sexy_girl 阅读(206) 评论(0) 推荐(0) 编辑
摘要: var Pubsub = (function (window) { window.handlers = {}; var o = { pub: function () { var args = Array.prototype.slice.call(arguments,0), event = args.shift(); var cbs = handlers[event]; if (cbs) { ... 阅读全文
posted @ 2013-12-17 11:06 sexy_girl 阅读(155) 评论(0) 推荐(0) 编辑
摘要: //闭包的一种用法 function foo(index){ var foo_index =index; return function(){ console.log(foo_index); } } var a1 = foo(1); var a2 = foo(2); a1();a2();1;2; 阅读全文
posted @ 2013-12-16 10:26 sexy_girl 阅读(126) 评论(0) 推荐(0) 编辑
摘要: console.log()用法,相信大家都很熟悉了,这里就不再啰嗦。下面来玩几个新鲜点的,我用的是chrome28,不保证兼容其他浏览器:console.log的第一个参数中可以指定一个格式字符,这样第二个参数就可以定义替换文本或其他内容。%c表示定义一个用于显示参数内容的css样式%s表示定义替换文本1. 给输出到控制台的内容定义颜色、字体等console.log(‘%cHello World’, ‘color: #00c’)console.log(‘%cHello %cWorld’, ‘color: #00c’, ‘color:#0c0;font-size:18px;’)参数中的占位符可定 阅读全文
posted @ 2013-12-15 23:17 sexy_girl 阅读(352) 评论(0) 推荐(0) 编辑
摘要: //清单 6. JavaScript instanceof 运算符代码 function instance_of(L, R) {//L 表示左表达式,R 表示右表达式 var O = R.prototype;// 取 R 的显示原型 L = L.__proto__;// 取 L 的隐式原型 while (true) { if (L === null) return false; if (O === L)// 这里重点:当 O 严格等于 L 时,返回 true return true; L = L.__proto__; } }//在ze... 阅读全文
posted @ 2013-12-15 12:49 sexy_girl 阅读(197) 评论(0) 推荐(0) 编辑
摘要: //转化为camel形式 var text = 'border-color-base'; text.replace(/-(\w{1})/g, function (match, chr1) { return chr1.toUpperCase(); }); //转化为dash形式 var text = 'borderColorBase'; // AAAbb, AbbAA, aBBBa //比如AAAbb,得到AA_Abb text.replace(/([A-Z]+)([A-Z][a-z])/g, "$1_$2"). ... 阅读全文
posted @ 2013-12-14 22:43 sexy_girl 阅读(209) 评论(0) 推荐(0) 编辑
摘要: /* Zepto v1.0-1-ga3cab6c - polyfill zepto detect event ajax form fx - zeptojs.com/license */;(function(undefined) { if (String.prototype.trim === undefined) // fix for iOS 3.2 String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, '') } // For iOS 3.x // from https://develope 阅读全文
posted @ 2013-12-13 17:01 sexy_girl 阅读(415) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 15 下一页