Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Document code with descriptive comments. **HTML FILE ** **JS FILE ***** /* uses the getEvent() function to return the HTML code contain in the daily

image text in transcribed

Document code with descriptive comments.

**HTML FILE **

**JS FILE *****

/*

uses the getEvent() function to return the

HTML code contain in the daily events

*/

function getEvent(day) {

var eventHTML;

switch (day) {

case 0: // Sunday Events

eventHTML = "

\

H..n
\

A..n

\

LXn: Room A414

\

TiX: 12 am – 4 pm

\

CXt: free

\

\

B..a
\

R...m

\

LXon: F..e

\

TXe: 7 pm &ndash 10 pm

\

CXt: $..s

\

\

";

break;

case 1: // M..s

eventHTML = "

\

M..s
\

P..s

\

LXn: U..m

\

Te: 7 pm – 11 pm

\

Ct: xx

\

\

D.. Series
\

C c E g s...y

\

Lon: u r

\

Time: 7 9

\

Cost: ..d

\

\

";

break;

case 2: // Tuesday Events

eventHTML = "

\

a s
\

Make .. yours.

\

L n: Ul

\

T e: 9 am – 5 pm

\

C t: free

\

\

S s
\

Former ..am, \

.., Jr.

\

Location: Room 178

\

Time: 7 pm – 8:30 pm

\

Cost: free

\

\

";

break;

case 3: // W..s

eventHTML = "

\

Volunteer Fair
\

Over .., etc.

\

Location: Union Great Hall

\

Time: 9 am – 5 pm

\

Cost: free

\

\

U e
\

V.. e.

\

L n: Room 125

\

T e: 5 pm – 6:30 pm

\

C t: free

\

\

I..a
\

Close-Up (Iran)

\

L n: Oakside Theater

\

T e: 7 pm – 9 pm

\

C t: free

\

\

";

break;

case 4: // Thursday Events

eventHTML = "

\

Thursday e
\

New .. your slot.

\

L n: Union Circle

\

T e: 8 pm – 11:30 pm

\

Cost: free

\

\

Midnight Cinema
\

Amerika From ...

\

L n: F..e

\

T e: 10 pm – 11:30 pm

\

C t: free

\

\

Late Night Yoga
\

Sample Union.

\

Location: Rm B201

\

Time: 6 pm – 7:15 pm

\

Cost: free .. session)

\

\

";

break;

case 5: // Friday Events

eventHTML = "

\

C r
\

Meet .. interests.

\

Location: Room A210

\

Time: 11:30 am – 1 pm

\

Cost: free

\

\

Behind the Beat
\

Clyde .. blues.

\

Location: Great Hall

\

Time: 7 pm – 10 pm

\

Cost: free

\

\

F s
\

Me

\

Location: F Circle

\

Time: 7 ..t

\

Cost: $5.50

\

\

";

break;

case 6: // sat

eventHTML = "

\

Kites on the Concourse
\

Enjoy .. invention.

\

Location: Uni..e

\

Time: 10 am – 3 pm

\

Cost: free

\

\

Saturday .. s
\

Play .. night.

\

Location: Union Game Room

\

Time: 7 pm – 11:30 pm

\

Cost: $4.25 with student ID

\

\

Great Hall Music Ball
\

Ian ock.

\

Location: Great Hall

\

Time: 8 pm – midnight

\

Cost: ID

\

\

";

break;

}

return eventHTML

}

Linking JS File Go to the bc_union.html file. Directly above the closing tag, insert a script element that links the page to the bc_today.js file. Defer the loading of the script until after the rest of the page is loaded by the browser Go to the bc_today.js file in your editor. At the top of the file, insert a statement indicating that the code will be handled by the browser assuming strict usage. Note that within the file is the getEvent0 function, which returns the HTML code for the daily events at the union given a day number ranging from 0 (Sunday) to 6 (Saturday) Variable Declaration Declare the thisDate variable containing the Date object for the date October 12, 2018. Declare the dateString variable containing the text of the thisDate variable using local conventions. Declare the dateHTML variable containing the following text string

date

where date is the value of the dateString variable Create the thisDay variable containing the day of the week number from the thisDate variable (Hint: Use the getDav method.) Function Call Using the thisDay variable as the parameter value, call the getEventO function to get the HTML code of that day's events and store that value in a variable named eventHTML Page Elements Applying the value of the dateHTML plus the eventHTM variables before the end of the element contents. method to the page element with the ID "unionToday, insert the

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Temporal Databases Research And Practice Lncs 1399

Authors: Opher Etzion ,Sushil Jajodia ,Suryanarayana Sripada

1st Edition

3540645195, 978-3540645191

More Books

Students also viewed these Databases questions

Question

=+1. What were the variables of interest in this study?

Answered: 1 week ago