/    Sign up×
Community /Pin to ProfileBookmark

Alert Box for specific day/time

I have the following script (which I modified from another post) to pop-up an alert box during specific days/times. I can get the alerts to pop-up when I use a button – onclick. But when I add the day/time function I get an object expected when I click any of the buttons that call the functions. I know it must be syntax error, but I can’t figure it out. thanks.

<SCRIPT LANGUAGE=”text/JavaScript”>

function drawAlertsat () {
alert (“The site is undergoing scheduled maintenance until Sunday 6:00 am (EST). You may experience problems signing in during this scheduled maintenance period.”);
}

function drawAlertsun () {
alert (“The site is undergoing scheduled maintenance until Monday 1:00 am (EST). You may experience problems signing in during this scheduled maintenance period.”);
}

function drawAlertwkday () {
alert (“The site is undergoing scheduled maintenance until Thursday 2:00 am (EST). You may experience problems signing in during this scheduled maintenance period.”);
}

var today=new Date();
function MntAlert(today.getDay()) {
case 0:
if today.getHours()<6 {
drawAlertsat();
}
if today.getHours()>8 {
drawAlertSun;
}
break;
case 1:
if today.getHours()<1 {
drawAlertSun();
}
break;
case 3:
if today.getHours()>=22 {
if today.getDate()<=7 {
drawalertwkday();
break;
}
if today.getDate()<=21&&today.getDate()>=15 {
drawalertwkday();
}
}
break;
case 4:
if today.getHours()<2 {
drawAlertwkday();
}
break;
case 6:
if today.getHours()=23 {
if today.getminutes()>=45 {
drawAlertsat();
}
}
break;
}
</SCRIPT>

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@lschafferauthorMay 19.2005 — Fixed it.
×

Success!

Help @lschaffer spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...