JavaScript如何清除cookies?
JavaScript如何清除cookies?
[解决办法]
Cookie c = new Cookie(“userId”,”landril”);
c.setMaxAge(0);
[解决办法]
<script language= "Javascript ">
document.cookie = "v0=1; ";
document.cookie = "v1=2; ";
alert(document.cookie);
function deletecookie(cName)
{
var d = new Date(2000,1,1);
document.cookie = cName + "=;expires= " + d.toGMTString() + "; " + "; ";
alert(document.cookie);
}
</script>
<input onclick= "deletecookie( 'v0 ') " value= "delete v0 " type=button>