这个非常基本的脚本创建3个变量在页面上使用,今天的日期在一个首选的格式,从今天+ 90天的日期和从今天+120天的日期。铬问题与javascript setDate
它在Chrome适用于Firefox和IE很大,但是这些变量来为“不确定”和控制台输出这样的: “遗漏的类型错误:对象错误已经没有法‘的setDate’”
这里是我的JavaScript
var today = new Date();
var rg = (today.getMonth()+1) + "/" + today.getDate() + "/" + today.getFullYear();
var closed = new Date();
closed.setDate(today.getDate()+90);
var cl = (closed.getMonth()+1) + "/" + closed.getDate() + "/" + closed.getFullYear();
var expire = new Date();
expire.setDate(today.getDate()+120);
var ex = (expire.getMonth()+1) + "/" + expire.getDate() + "/" + expire.getFullYear();
它出现在Chrome浏览器工作正常[这里](http://jsfiddle.net/Jf4Vv/)。如果它不适合你,那么你的Chrome版本是什么? – Snuffleupagus
“Uncaught TypeError:Object false has no method'setDate”--- for which which line? – zerkms
在Chrome中适用于我(在Mac OS和Windows上)。 – kinakuta