第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

請問jQuery.cookie is not a function?

請問jQuery.cookie is not a function?

BIG陽 2019-06-19 19:15:39
jQuery.cookie is not a function
查看完整描述

4 回答

?
蠱毒傳說

TA貢獻(xiàn)1895條經(jīng)驗 獲得超3個贊

jQuery.cookie = function(name, value, options) {

if (typeof value != 'undefined') {
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();
}
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 {
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
if (cookie.substring(0, name.length + 1) == (name + '=')) {
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
break;
}
}
}
return cookieValue;
}
}
$.cookie(name, value, {expires, path, domain, secure}); // 創(chuàng)建COOKIE
$.cookie(name); // 獲取COOKIE



查看完整回答
反對 回復(fù) 2019-06-29
?
慕娘9325324

TA貢獻(xiàn)1783條經(jīng)驗 獲得超4個贊

var date=new Date();
date.setTime(date.getTime()+30*60*1000); //設(shè)置date為當(dāng)前時間+30分
document.cookie="key=value; expires="+date.toGMTString(); //將date賦值給expires

查看完整回答
反對 回復(fù) 2019-06-29
  • 4 回答
  • 0 關(guān)注
  • 742 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號