Skip to content

Instantly share code, notes, and snippets.

View hawx1993's full-sized avatar
💭
I may be slow to respond.

trigkit4 hawx1993

💭
I may be slow to respond.
View GitHub Profile
@hawx1993
hawx1993 / isjs.js
Created October 9, 2017 02:20
判断是否是js文件
var isJS = function (file) { return /\.js(\?[^.]+)?$/.test(file); };
//bind
function bind(fn, ctx) {
return function (a) {
var l = arguments.length;
return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) : fn.call(ctx);
};
}
//entend
.clearfix:after{
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
.clearfix{
*zoom:1;
}
//获取当前时间
var date=new Date();
//将date设置为过去的时间
date.setTime(date.getTime()-10000);
//将userId这个cookie删除
document.cookie="userId=828; expires="+date.toGMTString();