Skip to content

Instantly share code, notes, and snippets.

View JagoWang's full-sized avatar
🌾

Jago JagoWang

🌾
View GitHub Profile
/**
* 分析豆瓣阅读查看电子书的逻辑
*
* 主要用到的JavaScript为
* 1. OzJS(管理模块)
* 2. jQuery(base库)
* 3. Backbone.js(web application框架)
*
* 过程分析
* --------
@JagoWang
JagoWang / keepalived + nginx
Created March 7, 2013 10:30
keepalived + nginx
keepalived + nginx
容灾+负载
<script type="text/javascript">
Array.prototype.ayromove = function(dx) {
if(isNaN(dx)||dx>this.length){return false;}
this.splice(dx,1);
}
var arr = ['a', 'b', 'c'];
console.log("elements: "+ arr + " nLength: " + arr.length);
arr.ayromove(1); //删除下标为1的元素
console.log("elements: "+ arr + " nLength: " + arr.length);
</script>
@JagoWang
JagoWang / Markdown syntax test
Last active August 29, 2015 13:57
Markdown syntax test
*强调*
@JagoWang
JagoWang / JS获取请求参数
Created July 10, 2015 01:56
JS获取请求参数数组及指定参数
//获取请求参数数组
function getUrlVars(){
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}