js读取cookie例如:request.cookies("cookieName")("a") 在js.js文件里我如何读
Var cooievalue= ?希望高手根据我这种形式的cookie帮一下忙,只需要读取到cookie值就好了,先谢!
Var cooievalue= ?希望高手根据我这种形式的cookie帮一下忙,只需要读取到cookie值就好了,先谢!
解决方案 »
- Extjs3.4 JS加载顺序问题
- 怎样用javascript改鼠标的样式哦,我想做QQ相册图片那样的,把鼠标放上去后有上一张和下一张的鼠标箭头?
- 在页面顶上有办法区分吗?
- 为什么这样会出错呢?
- 如何在ASP中调用写好的JAVASCRIPT文件中的方法。
- 请教如何判断一个字符串,是否符合如下格式?字母或数字(13开头的13位数字)豆号或分号字母或数字(13开头的13位数字)......
- 急急急!100分求够一个小程序,在本地网页里调用本地机子上的一个程序(exe),直接运行,不要谈出什么安全警告!谢谢,在线等
- 怎么找到对应的span中的input的值?
- 有关VML问题,怎么画一个三角形向左方向的!谢谢了
- 鼠标点击问题
- 公司要求 没办法 求拼音 对照 汉字的 对照表
- 如何动态在原有table中添加多列
// Create a cookie with the specified name and value.
// The cookie expires at the end of the 20th century.
function SetCookie(sName, sValue)
{
date = new Date();
document.cookie = sName + "=" + escape(sValue) + "; expires=" + date.toGMTString();
}// Retrieve the value of the cookie with the specified name.
function GetCookie(sName)
{
// cookies are separated by semicolons
var aCookie = document.cookie.split("; ");
for (var i=0; i < aCookie.length; i++)
{
// a name/value pair (a crumb) is separated by an equal sign
var aCrumb = aCookie[i].split("=");
if (sName == aCrumb[0])
return unescape(aCrumb[1]);
}
// a cookie with the requested name does not exist
return null;
}// Delete the cookie with the specified name.
function DelCookie(sName)
{
document.cookie = sName + "=" + escape(sValue) + "; expires=Fri, 31 Dec 1999 23:59:59 GMT;";
}</SCRIPT>
如何?
function GetCookie(sName)
{
// cookies are separated by semicolons
var aCookie = document.cookie.split("; ");
for (var i=0; i < aCookie.length; i++)
{
// a name/value pair (a crumb) is separated by an equal sign
var aCrumb = aCookie[i].split("=");
if (sName == aCrumb[0])
return unescape(aCrumb[1]);
}var caller=GetCookie("a");
如果没.就是你的cookie没值...
var a=document.cookie.split('cooiename=');
var b=a[1].split(';');
alert(b[0]);看看是不是你要的.
function dialDemo(){
var a=document.cookie.split('cooiename=');
var b=a[1].split(';'); var caller=b[0];var callee=$('#number').val(); singheadDial(caller,callee); }