油价调整,台州地震,208路公交车路线
(1)首先,介绍一下javascript操作cookie的基础
//去除空格,回车
string.prototype.trim = function()
{
return this.replace(/(^\s*)|(\s*$)/g, "");
}
//设置cookie
function setcookie(c_name, c_value,expiredays)
{
var exdate=new date();
exdate.setdate(exdate.getdate()+expiredays);
document.cookie = c_name + "=" + escape(c_value) +
((expiredays==null) ? "" : ";expires="+exdate.togmtstring());
}
//按名字读取cookie
function getcookie(c_name)
{
if (document.cookie.length>0)
{
var m_car=document.cookie.split(';');
var value=-1;
for (i = 0; i < m_car.length; i++)
{
if(c_name.tostring().trim()==((m_car[i].split('='))[0]).tostring().trim())
{
value = (m_car[i].split('='))[1];
}
}
}
return value;
}
摘自 南南的空间
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Net Core Web Api项目与在NginX下发布的方法
asp.net core3.1 引用的元包dll版本兼容性问题解决方案
IdentityServer4实现.Net Core API接口权限认证(快速入门)
ASP.NET Core MVC通过IViewLocationExpander扩展视图搜索路径的实现
网友评论