Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
[b][COLOR=#0000FF]var[/color][/b] divID [COLOR=#990000]=[/color] [COLOR=#FF0000]'#someDiv'[/color][COLOR=#990000];[/color] [i][COLOR=#9A1900]//ID of div holding the message[/color][/i]
[b][COLOR=#0000FF]var[/color][/b] messages [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] [b][COLOR=#000000]Array[/color][/b][COLOR=#990000]([/color][COLOR=#FF0000]"Monday"[/color][COLOR=#990000],[/color] [COLOR=#FF0000]"Tuesday"[/color][COLOR=#990000],[/color] [COLOR=#FF0000]"Wednesday"[/color][COLOR=#990000],[/color] [COLOR=#FF0000]"Thursday"[/color][COLOR=#990000],[/color] [COLOR=#FF0000]"Friday"[/color][COLOR=#990000],[/color] [COLOR=#FF0000]"Saturday"[/color][COLOR=#990000],[/color] [COLOR=#FF0000]"Sunday"[/color][COLOR=#990000]);[/color]
[b][COLOR=#0000FF]var[/color][/b] cDay [COLOR=#990000]=[/color] [COLOR=#990000]-[/color][COLOR=#993399]1[/color][COLOR=#990000];[/color]
[b][COLOR=#0000FF]var[/color][/b] displayMessage [COLOR=#990000]=[/color] [b][COLOR=#0000FF]function[/color][/b][COLOR=#990000]()[/color][COLOR=#FF0000]{[/color]
[tab][b][COLOR=#0000FF]var[/color][/b] d [COLOR=#990000]=[/color] [b][COLOR=#000000]getDay[/color][/b][COLOR=#990000]([/color] [COLOR=#993399]10[/color] [COLOR=#990000]);[/color] [i][COLOR=#9A1900]//change this if you want another hour to be the threshold[/color][/i]
[tab][b][COLOR=#0000FF]if[/color][/b] [COLOR=#990000]([/color]d [COLOR=#990000]==[/color] cDay[COLOR=#990000])[/color] [b][COLOR=#0000FF]return[/color][/b][COLOR=#990000];[/color]
[tab]cDay [COLOR=#990000]=[/color] d[COLOR=#990000];[/color]
[tab]document[COLOR=#990000].[/color][b][COLOR=#000000]getElementById[/color][/b][COLOR=#990000]([/color]divID[COLOR=#990000]).[/color]innerHTML [COLOR=#990000]=[/color] messages[COLOR=#990000][[/color]cDay[COLOR=#990000]];[/color]
[COLOR=#FF0000]}[/color]
[b][COLOR=#0000FF]var[/color][/b] getDay [COLOR=#990000]=[/color] [b][COLOR=#0000FF]function[/color][/b][COLOR=#990000]([/color] switchTime [COLOR=#990000])[/color][COLOR=#FF0000]{[/color]
[tab][tab]switchTime [COLOR=#990000]=[/color] [b][COLOR=#000000]parseInt[/color][/b][COLOR=#990000]([/color]switchTime[COLOR=#990000])[/color] [COLOR=#990000];[/color] [i][COLOR=#9A1900]//just in case a value like "04" is passed[/color][/i]
[tab][tab][b][COLOR=#0000FF]if[/color][/b] [COLOR=#990000]([/color]switchTime [COLOR=#990000]>[/color] [COLOR=#993399]23[/color] [COLOR=#990000]||[/color] switchTime [COLOR=#990000]<[/color] [COLOR=#993399]0[/color][COLOR=#990000])[/color] [b][COLOR=#0000FF]return[/color][/b] [b][COLOR=#0000FF]false[/color][/b][COLOR=#990000];[/color] [i][COLOR=#9A1900]//refuse improper values; must be between 0 -23[/color][/i]
[tab][b][COLOR=#0000FF]var[/color][/b] d [COLOR=#990000]=[/color] [b][COLOR=#0000FF]new[/color][/b] [b][COLOR=#000000]date[/color][/b][COLOR=#990000]();[/color]
[tab][b][COLOR=#0000FF]var[/color][/b] day [COLOR=#990000]=[/color] d[COLOR=#990000].[/color][b][COLOR=#000000]getDay[/color][/b][COLOR=#990000]();[/color]
[tab][b][COLOR=#0000FF]var[/color][/b] hour [COLOR=#990000]=[/color] d[COLOR=#990000].[/color][b][COLOR=#000000]getHours[/color][/b][COLOR=#990000]();[/color]
[tab][b][COLOR=#0000FF]if[/color][/b] [COLOR=#990000]([/color]hour [COLOR=#990000]<[/color] switchTime[COLOR=#990000])[/color] [COLOR=#FF0000]{[/color]
[tab][tab]day [COLOR=#990000]=[/color] day [COLOR=#990000]==[/color] [COLOR=#993399]0[/color] [COLOR=#990000]?[/color] [COLOR=#993399]6[/color] [COLOR=#990000]:[/color] day [COLOR=#990000]-[/color] [COLOR=#993399]1[/color][COLOR=#990000];[/color]
[tab][COLOR=#FF0000]}[/color]
[tab][b][COLOR=#0000FF]return[/color][/b] day[COLOR=#990000];[/color]
[COLOR=#FF0000]}[/color]
[b][COLOR=#0000FF]var[/color][/b] myTimer [COLOR=#990000]=[/color] [b][COLOR=#000000]setInterval[/color][/b][COLOR=#990000]([/color] displayMessage[COLOR=#990000],[/color] [COLOR=#993399]60000[/color] [COLOR=#990000]);[/color]