社会“高速发展”到2012后发现下个插件都是那么难,这个网站要注册,那个网站要求你是会员,在这里你无须注册,把下面代码copy走新建一个记事本保存成.js格式的即可!
又近五一了,时间过的好快......
jQuery.cookie = function(name, value, options)
{
if (typeof
value != 'undefined') { // name and value given, set cookie
options = options || {};
if (value === null) {
value = '';
options.expires = -1;
}
var expires = '';
if (options.expires && (typeof
options.expires == 'number' || options.expires.toUTCString))
{
var date;
if (typeof options.expires == 'number') {
date = new Date();
date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 *
1000));
} else {
date = options.expires;
}
expires = '; expires=' + date.toUTCString(); // use expires
attribute, max-age is not supported by IE
}
// CAUTION: Needed to parenthesize options.path and
options.domain
// in the following expressions, otherwise they evaluate to
undefined
// in the packed version for some reason...
var path = options.path ? '; path=' + (options.path) : '';
var domain = options.domain ? '; domain=' + (options.domain) :
'';
var secure = options.secure ? '; secure' : '';
document.cookie = [name, '=', encodeURIComponent(value), expires,
path, domain, secure].join('');
} else { //
only name given, get cookie
var cookieValue = null;
if (document.cookie &&
document.cookie != '') {
var cookies = document.cookie.split(';');