🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.javascript
Article #386

cookie

#386
From: mrowl
Date: Fri, 11 Jan 2002 09:15
37 lines
1797 bytes
Czy moze jest ktos w stanie mi pomóc i powiedzieć co jest nieprawidłowego w 
następującym kodzie obsługi Cookie, wszystko działa mi poprawnie pod IE6 i NC6 
a pod innymi przeglądarkami pojawia się błąd że kod jest nieprawidłowy.

function setCookie(Name, Value)
{
	var today = new Date();
	var expires = new Date();
	expires.setTime(today.getTime() + 1000*60*60*24*7);
//	document.cookie = Name + "=" + escape(Value) + ((expires == 
null) ? "" : ("; expires=" + expires.toGMTString()));
}

function getCookie(Name)
{
	var search = Name + "=";
	if (document.cookie.length > 0 )
	{
		offset = document.cookie.indexOf(search);
	    if (offset != (-1))
	    {
			offset += search.length;
			end = document.cookie.indexOf(";", offset);
	    	if (end == -1)
	       		end = document.cookie.length;
			return unescape(document.cookie.substring(offset, 
end));
		}
	}
}

mr-owl

P.S. Z góry dziękuję za pomoc...

-- 
Wysłano z serwisu OnetNiusy: http://niusy.onet.pl
Technical Details
Message-ID: <194a.000013cc.3c3ead4b@newsgate.onet.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!news.icm.edu.pl!news.onet.pl!newsgate.onet.pl!niusy.onet.pl

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!news.icm.edu.pl!news.onet.pl!newsgate.onet.pl!niusy.onet.pl
From: <mrowl@poczta.onet.pl>
Newsgroups: pl.comp.lang.javascript
Subject: cookie
Date: 11 Jan 2002 10:15:55 +0100
Organization: Onet.pl SA
Lines: 37
Message-ID: <194a.000013cc.3c3ead4b@newsgate.onet.pl>
NNTP-Posting-Host: newsgate.test.onet.pl
Mime-Version: 1.0
X-Trace: newsgate.onet.pl 1010740555 25195 192.168.240.245 (11 Jan 2002 09:15:55 GMT)
X-Complaints-To: abuse@onet.pl
NNTP-Posting-Date: 11 Jan 2002 09:15:55 GMT
X-Mailer: http://niusy.onet.pl
X-Forwarded-For: 213.77.156.186, 213.180.130.23
X-User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit