Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Needing an Alert box to pop up at a specific time!

  1. #1
    Join Date
    Jul 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Needing an Alert box to pop up at a specific time!

    Hi:
    I work at a Customer Service Center, and need to find a way to have an Alert Box state that it is thier break time, when it is thier break time! The trick is I have no access to server side, and need to know if it is possible using just HTML, Java, or whatever else.

    Any Help is Greatly Appreciated!

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,497
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Some questions:

    1 ) Who will see this alert box? Will it be the Service Center Employees or the Service Center's Clients? Both?

    2 ) Whoever is going to see this alert box, are they all in the same time zone?

    3 ) Is it reasonable to believe that the system clocks on the computers that will be displaying this alert box are set correctly?

    4 ) When should this alert box appear? As a certain page loads if it is also 'break time' or at any given time if it has become 'break time'.
    Last edited by jscheuer1; 07-15-2005 at 05:10 AM.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jul 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Here are the Answers!
    Some questions:

    1 ) Who will see this alert box? Will it be the Service Center Employees or the Service Center's Clients? Both?

    A: Just my direct reports, and will be driven from our "team's website"

    2 ) Whoever is going to see this alert box, are they all in the same time zone?

    A: Just my direct reports, and we all are in the same building

    3 ) Is it reasonable to believe that the system clocks on the computers that will be displaying this alert box are set correctly?

    A: Yes, they are in sync with the companies servers.

    4 ) When should this alert box appear? As a certain page loads if it is also 'break time' or at any given time if it has become 'break time'.

    A: At the begginning of the day the web page is loaded by each direct report, and the Alert box will not pop up for a couple of hours until there break time starts.

    I Hope this helps, and thanks for any help!

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,497
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    This should do it then, place anywhere on the page:

    Code:
    <script type="text/javascript">
    function breakTime(){ // <<< do not edit or remove this line!
    /* Set Break Hour in 24hr Notation */
    var breakHour=9
    /* Set Break Minute */
    var breakMinute=5
    /* Set Break Message */
    var breakMessage="Reports! Take Your Break!"
    ///////////////////No Need to Edit//////////////
    var theDate=new Date()
    if (Math.abs(theDate.getHours())==breakHour&&Math.abs(theDate.getMinutes())==breakMinute){
    this.focus();
    clearInterval(breakInt)
    alert(breakMessage)
    }
    }
    var breakInt=setInterval("breakTime()",58000)
    ////////////////////////////////////////////////
    </script>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jul 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks.....works like a charm!

    I only have one last question, and you will have solved my every problem.

    My reports have two breaks and a lunch, is there anyway to duplicate this to do this for a total of three alerts??

    Thanks for any help you can provide!

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,497
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Code:
    <script type="text/javascript">
    function breakTime(){ // <<< do not edit or remove this line!
    /* Set Break Hours in 24hr Notation */
    var breakHour=[9, 12, 15]
    /* Set Break Minutes */
    var breakMinute=[15, 0, 15] 
    /* Set Break Messages */
    var breakMessage=["Reports! Take Your Break!", "Lunch Time!", "Afternoon Break!"]
    ///////////////////No Need to Edit//////////////
    var theDate=new Date()
    for (i = 0; i < breakHour.length; i++)
    if (Math.abs(theDate.getHours())==breakHour[i]&&Math.abs(theDate.getMinutes())==breakMinute[i]){
    window.focus();
    clearInterval(breakInt)
    alert(breakMessage[i])
    if (i<breakHour.length-1)
    setTimeout("breakInt=setInterval('breakTime()',58000)",120000)
    }
    }
    var breakInt=setInterval("breakTime()",58000)
    ////////////////////////////////////////////////
    </script>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Jul 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    The only thing I notice is that the Popups are sparatic, Either they will fire late, or won't fire at all. I have had it fire the first one, and skip the last two, or will do the second one and skip the first and third, here is the small page that I put together, maybe I put something wrong, or there has to be a longer time between each popup.....any help is appreciated:

    HTML Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    
    <HTML>
    <HEAD>
    <TITLE>Untitled</TITLE>
    <META NAME="GENERATOR" CONTENT="MAX's HTML Beauty++ 2004">
    </HEAD>
    
    <BODY>
    <script type="text/javascript">
    function breakTime(){ // <<< do not edit or remove this line!
    /* Set Break Hours in 24hr Notation */
    var breakHour=[22, 22, 22]
    /* Set Break Minutes */
    var breakMinute=[38, 40, 42] 
    /* Set Break Messages */
    var breakMessage=["Test", "Test1", "Test2"]
    ///////////////////No Need to Edit//////////////
    var theDate=new Date()
    for (i = 0; i < breakHour.length; i++)
    if (Math.abs(theDate.getHours())==breakHour[i]&&Math.abs(theDate.getMinutes())==breakMinute[i]){
    window.focus();
    clearInterval(breakInt)
    alert(breakMessage[i])
    if (i<breakHour.length-1)
    setTimeout("breakInt=setInterval('breakTime()',58000)",120000)
    }
    }
    var breakInt=setInterval("breakTime()",58000)
    ////////////////////////////////////////////////
    </script>
    
    
    </BODY>
    </HTML>


    _________________________________
    Thanks
    Last edited by keyboard; 09-28-2018 at 02:31 AM. Reason: Format: HTML Tags

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,497
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    It has to be more than 2 minutes between each pop up. With three breaks scattered throughout the workday, I figured requiring an interval of at least three minutes between breaks was reasonable. They might pop up with less than 3 minutes between them but, not likely. I wanted to be reasonably sure that the interval checking for the previous break was cleared before initializing the next. We cannot use the same interval for all three breaks because that would cause the pop up to repeat if clicked too soon - annoying. It would also prevent us from canceling the interval altogether once the last break was past. Are these pages left up all night? If so, we will need an initializing event other than the page being loaded first time in the morning.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  9. #9
    Join Date
    Jul 2005
    Location
    Kuwait-I'm American
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Is there a way, that if let's say some1 got in late, when they open the page, it gives thbem a pop-up: "YOU'RE LATE!"
    //\\ //\\// || //\\//\\ //\\ ||_
    SOFTWARE

  10. #10
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,497
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Yes but, that would be pointless. They already know that they are late and no one else would see it or know about it.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •