看这段程序:
// 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;
}
// 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;
}
解决方案 »
- JavaScript遇到命名冲突怎么办?
- 这段js代码不好懂
- 使用scriptX控件打印表格的问题~!~!
- 请问这段代码总是提示函数未定义
- 还是eval的问题在XmlHttp中,感谢:myvicy(热心肠的人)
- js实现图片下载
- 救急!!!!!麻烦!
- 如何使框架禁止使用ctrl+n,ALT+f4
- 用javascript如何屏蔽html代码?
- 求指导关于动态添加的元素绑定Jquery datepicker、autocomplete等事件的方法
- 一个简单问题!!==>>页面b打开页面a,a关闭时返回值到b中的文本框里,这样写对吗?<A HREF='#' onClick="javascript:self.opener.form[0
- 请问大家。为什么有时候找得到控件的ID,有时候却找不到?这是怎么回事?
var arr = str.split(/,/);
for (var i=0; i < arr.length; i++)
alert(arr[i]);