Re: FAQ Topic - How can I see in javascript if a web browser accepts cookies? (2009-12-20)
- From: Thomas 'PointedEars' Lahn <PointedEars@xxxxxx>
- Date: Mon, 28 Dec 2009 12:59:57 +0100
Garrett Smith wrote:
Thomas 'PointedEars' Lahn wrote:
Garrett Smith wrote:
Garrett Smith wrote:
If needed, I rather have a one-time test:-
var SUPPORTS_COOKIES = document.cookie == "string";
Whoops, how about:
typeof document.cookie == "string";
How about not doing this at all? It is a property of a host object;
even if you can assign it a string, it does not need to yield "string"
for `typeof'. That said, the test is probably superfluous by now, and
potentially misleading.
I haven't tried ZoneAlarm, so I can't say.
Apparently, ZoneAlarm replaces document.cookie with document.ignore:-
Irrelevant.
if(typeof document.cookie == "string"){
with
if(typeof document.ignore == "string"){
document.cookie is specified to be a domstring.
It is not specified at all. The HTMLDocument interface of W3C DOM Level 2
HTML, of which we assume that it is implemented by the object referred to
by `document', has a `cookie' attribute of type DOMString, and the
ECMAScript Language Binding section of W3C DOM Level 2 HTML says that
objects that implement this interface should have a String-type property
named `cookie'.
it could be expected to be a string value.
But should not. It is sufficient that it yields a string value on read
access and accepts one on write access.
The typecheck might help prevent an error, but I can't say I know about
ZoneAlarm or other firewalls, but it is worth considering preventing
errors.
It is not. Everyone using (snake-oil) software borken like this deserve
what they get.
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f806at$ail$1$8300dec7@xxxxxxxxxxxxxxxx>
.
- References:
- FAQ Topic - How can I see in javascript if a web browser accepts cookies? (2009-12-20)
- From: FAQ server
- Re: FAQ Topic - How can I see in javascript if a web browser accepts cookies? (2009-12-20)
- From: Garrett Smith
- Re: FAQ Topic - How can I see in javascript if a web browser accepts cookies? (2009-12-20)
- From: Thomas 'PointedEars' Lahn
- Re: FAQ Topic - How can I see in javascript if a web browser accepts cookies? (2009-12-20)
- From: Garrett Smith
- Re: FAQ Topic - How can I see in javascript if a web browser accepts cookies? (2009-12-20)
- From: Dr J R Stockton
- Re: FAQ Topic - How can I see in javascript if a web browser accepts cookies? (2009-12-20)
- From: Thomas 'PointedEars' Lahn
- Re: FAQ Topic - How can I see in javascript if a web browser accepts cookies? (2009-12-20)
- From: Garrett Smith
- Re: FAQ Topic - How can I see in javascript if a web browser accepts cookies? (2009-12-20)
- From: Garrett Smith
- Re: FAQ Topic - How can I see in javascript if a web browser accepts cookies? (2009-12-20)
- From: Thomas 'PointedEars' Lahn
- Re: FAQ Topic - How can I see in javascript if a web browser accepts cookies? (2009-12-20)
- From: Garrett Smith
- FAQ Topic - How can I see in javascript if a web browser accepts cookies? (2009-12-20)
- Prev by Date: Re: Code Guidelines
- Next by Date: Re: Code Guidelines
- Previous by thread: Re: FAQ Topic - How can I see in javascript if a web browser accepts cookies? (2009-12-20)
- Next by thread: Re: FAQ Topic - How can I see in javascript if a web browser accepts cookies? (2009-12-20)
- Index(es):
Relevant Pages
|