document.cookie 是否未定义?
Is document.cookie ever undefined?
我只是好奇 document.cookie
是否可以 return undefined
.
我读过 quirksmode's article on cookies and I looked at "Is !document.cookie reliable?" 但他们没有明确回答这个问题。
document.cookie
可以成为 undefined
吗?
document.cookie
属性 是 defined in DOM Level 2, and implemented in every major browser。它 sets/gets 一个字符串,它可能是一个空字符串(这是错误的,但不是 undefined
)。
没有
您可以在此处阅读规范 http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-8747038
如果设置的值不符合规范,则会引发错误。
我只是好奇 document.cookie
是否可以 return undefined
.
我读过 quirksmode's article on cookies and I looked at "Is !document.cookie reliable?" 但他们没有明确回答这个问题。
document.cookie
可以成为 undefined
吗?
document.cookie
属性 是 defined in DOM Level 2, and implemented in every major browser。它 sets/gets 一个字符串,它可能是一个空字符串(这是错误的,但不是 undefined
)。
没有
您可以在此处阅读规范 http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-8747038
如果设置的值不符合规范,则会引发错误。