JavaScript写的Cookie类[1]

[入库:2005年8月18日] [更新:2007年3月25日]

本文简介:选择自 feng_sundy 的 blog

  1<script language="jscript"> 
  2function cookie(delim){ 
  3    this._cookie=[]; 
  4    this.load=function(){ 
  5        if(document.cookie.indexof(";")!=-1){ 
  6            var _sp,_name,_tp,_tars,_tarslength; 
  7            var _item=document.cookie.split(""); 
  8            var _itemlength=_item.length; 
  9            while(_itemlength>0){ 
 10                _sp=_item[--_itemlength].split("="); 
 11                _name=_sp[0]; 
 12                _tp=_sp[1].split(","); 
 13                _tars=_tp.slice(1,_tp.length); 
 14                this._cookie[_name]=[]; 
 15                this._cookie[_name]=_tars; 
 16                this._cookie[_name]["timeout"]=_tp[0]; 
 17                } 
 18            return true
 19            } 
 20        return false
 21        } 
 22
本文关键:JavaScript写的Cookie类
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top