在a页面中
document.cookie="test=ss;"
window.open('../popup/b.aspx)在b页面中
alert(document.cookie)弹出的是空 问题出在那里,是不是cookie不能在不同的页面使用,只能在同一个页面使用?
document.cookie="test=ss;"
window.open('../popup/b.aspx)在b页面中
alert(document.cookie)弹出的是空 问题出在那里,是不是cookie不能在不同的页面使用,只能在同一个页面使用?
看下这篇文章吧,专讲JSCOOKIE.
a.html<SCRIPT LANGUAGE="JavaScript">
<!--
document.cookie="test=ss;"
window.open("b.html");
//-->
</SCRIPT>
b.html<SCRIPT LANGUAGE="JavaScript">
<!--
function aa(){
alert(document.cookie)
}//-->
</SCRIPT>
<INPUT TYPE="button" onclick="aa()" value=' ok '>