時輸入錯誤是
線:3
字符:3「預期的對象」,試圖讓JavaScript的
var d = new Date();
var n = d.getHours();
var timeEnd = setHours(17);
var timeStart = setHours(15);
if(n < timeEnd && n > timeStart){
var r = confirm("Press a button");
if (r == true) {
x = "You pressed OK!";
_system.shutDown();
} else {
x = "You pressed Cancel!";
die;
}
}
else {
window.alert("This isn't the right time!")
}
如果有人能幫助我解決這個問題和其他錯誤,你看,那會很有幫助。
第3行,char 3在'var'中是'r'。我懷疑那裏有錯誤。請閱讀[問]。 –
你有一個叫做'setHours'的全局函數,或者你是否打算在'd'上調用它? – Biffen