Welcome to Prairie School District

Here at Prairie School District (PSD) we are committed to helping you succeed. PSD strives to do everything in our power to give you the tools you need to accomplish your goals. Please find the upcoming homework assignments table below for your reference. See the Homework page for full details.
| Class | Homework Assignment |
|---|---|
| IMD2151 | Individual Project (Unit 1) |
| Discusussion Board (Unit 1) | |
| Live Chat (Unit 1) | |
| CGR1251 | Group Project (Unit 1) |
| Discusussion Board (Unit 1) | |
| WDN1331 | Individual Project (Unit 1) |
| Live Chat (Unit 1) | |
Javascript Tip of the Week
This week's Javascript Tip of the Week is an example of how to create a daily message like the one you see at the top of this page showing the current date.
The "writeMsgOfDay()" Javascript function is seen below. Follow the commented lines that start with // to see what the function is doing.
- As you will see on lines 4-10, the function starts by setting all the variables for the current date and time.
- Next on lines 12-17, the code creates two arrays for the names of the weedays and months. This allows you to use the actual month and day names rather than the numbers.
- The next portion of code, on lines 19-28, check the hour variable to see if it is morning, afternoon or evening and creates an appropriate greeting message.
- On lines 30-32 you will see everything come together, this is where you concatenate all of the different date elements we've created to build the sMsg string variable. It wraps the message in a H2 element.
- On line 35 you see the document.write command that actually writes the sMsg variable to the web page. Without this, all the work would be for naught.
1 function writeMsgOfDay(){
2 // Writes the secondary header on the page with a unique message of the day
3
4 // Create date variables for today
5 var today = new Date();
6 var day = today.getDay();
7 var month = today.getMonth();
8 var date = today.getDate();
9 var year = today.getYear();
10 var hour = today.getHours(); 11
12 // Create array of weekdays
13 var weekday = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
14
15 // Create array of month names
16 var monthName = new Array("January","February","March","April","May","June","July","August",
17 "September","October","November","December"); 18
19 // Check time to see if it's morning, afternoon or evening and create appropriate message
20 var sGreeting;
21 if(hour < 4)
22 sGreeting = "Hello, night owl. ";
23 else if(hour < 12)
24 sGreeting = "Good morning. ";
25 else if(hour < 17)
26 sGreeting = "Good afternoon. ";
27 else if(hour <= 24)
28 sGreeting = "Good evening. "; 29
30 // Compile message of the day using date components previously created
31 var sMsg = "<h2>" + sGreeting + "Today is " + weekday[day] + ", " + monthName[month] + " " +
32 date + ", " + year + ".</h2>"; 33
34 // Write the message on the page
35 document.write(sMsg); 36 }