Thomas 'PointedEars' Lahn <PointedEars@web.de> writes:
[color=blue]
> Lisa wrote:[/color]
[color=blue][color=green]
> > function SetCookie(username, value, expires, path, domain)
> > { document.cookie = username + "=" + escape(value) +
> > ((expires == null) ? "" : "; expires=" + expires.toGMTString()) +[/color][/color]
....[color=blue]
>
> When a named argument of a function is not provided, its
> value is not `null' (since that represents a null, empty,
> or non-existent reference) but `undefined'. So you set the
> cookie's `path' and `domain' to `undefined' as you do not
> provide those arguments.[/color]
However, since Lisa uses "==" to compare, it still works, since
type conversion makes:
(undefined == null)
true.
(but yes, just using "expires" in the condition is sufficient)
/L
--
Lasse Reichstein Nielsen -
lrn@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'