九州编程
你的setCookie方法有点问题,改成下面的试试!我这试过可以的function setCookie(name, value, expires, path, domain, secure) {var today = new Date();if (expires) {expires = expires * 1000 * 60 * 60 * 24;}var expires_date = new Date(today.getTime() + expires);try {document.cookie+=name+"="+escape(value);if(value) document.cookie+=";expires=" + expires_date.toGMTString();if(path) document.cookie+=";path=" + path;if(domain)document.cookie+";domain=" + domain;if(secure)document.cookie+";secure" + secure;} catch (e) {throw Error(e);}}就是你那((expires) 这样的方式是不能用来做三目运算判断的!