日期:2014-05-18 浏览次数:20681 次
var date1 = new Date().getTime();
var date2 = new Date().getTime() + 1;
var date3 = new Date().getTime() + 2;
var result = false;
if(date1 < date2 && date2 < date3){
result = true;
}
alert(result);
var date1 = new Date().getTime();
var date2 = new Date().getTime() + 1;
var date3 = new Date().getTime() + 2;
var exps = "";
for(var i = 1 ; i < 3 ; i++){
exps += "date" + i + "<" + "date" + (i + 1) + " && ";
}
exps += "1 == 1";
var result = eval("{"+exps+"}");
alert(result);