Thread View: pl.comp.lang.javascript
1 messages
1 total messages
Started by mrowl
Fri, 11 Jan 2002 09:15
cookie
Author: mrowl
Date: Fri, 11 Jan 2002 09:15
Date: Fri, 11 Jan 2002 09:15
37 lines
1797 bytes
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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads