This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var girl_said = 'Girl: 不爱理你' | |
, programmer_s_prattle = 'Programmer: 我喜欢... 你'; | |
console.log(girl_said); | |
girl_said = girl_said.replace(/(?:with\_love)?(不|理)/g, function(ignore) { | |
// said in heart | |
console.log(programmer_s_prattle); | |
return ignore = ''; | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.ciao = function() { | |
console.log('没事爱瞎bb'); | |
return this; | |
}; | |
// 这样执行 | |
$().ciao().ciao().ciao(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"status":"error","error":{"msg":"\u6b64\u997f\u5355\u5df2\u6295\u8bc9","code":23}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 这语法挺正常的 | |
[].indexOf(0); // #1 | |
// 这命名相比上面就醉了 | |
[] instanceof Array; //#2 | |
// 和一面一样的语法,又醉了 | |
typeof []; //#3 | |
// 坑也多 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var range = function(num) { | |
return Array(num).fill(1).reduce(function(ret, item, i) { | |
return ret.concat(i + 1); | |
}, []); | |
}; | |
var select = function(num) { | |
var ID = '___list'; | |
var list = window[ID] || localStorage.getItem(ID); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<style> | |
.triggers .active {color:#f30;} | |
.targets div {display:none;} | |
.targets .active {display:block;} | |
</style> | |
<div class="triggers"> | |
<a href="#tab1" class="active">tab1</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@charset "utf-8"; | |
/* | |
@名称: base | |
@功能: 重设浏览器默认样式 | |
@例子: null | |
*/ | |
/* 防止用户自定义背景颜色对网页的影响 */ | |
html{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Request Del.icio.us Item Using jQuery.AJAX</title> | |
<style type="text/css"> | |
body{width:600px;margin:30px auto;font:13px georgia;} | |
ul{margin-left:1.3em;;padding:0;line-height:1.8;color:#aaa;} | |
ul a{color:#07f;} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="http://www.flickr.com/badge_code_v2.gne?count=1&display=latest&size=m&layout=x&source=all_tag&tag=love" type="text/javascript"></script> |
OlderNewer