Skip to content

Instantly share code, notes, and snippets.

View liujiangfeng's full-sized avatar
🌴
On vacation

Mr.melon liujiangfeng

🌴
On vacation
View GitHub Profile
@liujiangfeng
liujiangfeng / bind.js
Last active August 29, 2015 14:07
bind.js
if( !Function.prototype.bind ){
Function.prototype.bind = function( obj ){
var args =[], that = this;
if( arguments.length > 1){
args = [].slice.call(arguments , 2);
}
return function (arg){
return that.apply( obj , args.cancat([].slice.call.arg));
}
@liujiangfeng
liujiangfeng / getComputedStyle.js
Last active August 29, 2015 14:07
getComputedStyle.js
var cssStyleDeclaration = window.getComputedStyle(document.body, null),
@liujiangfeng
liujiangfeng / queryString.js
Last active August 29, 2015 14:07
queryString.js
var qs = (function(a) {
if (a == "") return {};
var b = {};
for (var i = 0; i < a.length; ++i)
{
var p=a[i].split('=', 2);
if (p.length == 1)
b[p[0]] = "";
else
b[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " "));