Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Summary

Summary web development lab2

Rating
-
Sold
-
Pages
3
Uploaded on
28-02-2023
Written in
2022/2023

web development lab2

Institution
Course

Content preview

lOMoARcPSD|14409931




Course: INFO3144
Professor: Jim Cooper
Project: Lab #2
Due Date: Monday/Tuesday, October 1/2, 2018 11:30 pm
Submitting: Submit your zipped solution to the Lab 2 drop-box

How will my lab be marked?
Marks How are the Marks Awarded? Mark
Available Assigned
3 Web page runs and meets the requirements listed below
1 Reasonable level of comments
1 Web Page is zipped and submitted on-time to the drop box
5 Total



Lab Description
This lab will require you to add some new code to the Lab2.html web page. As we’ve often done in
the past, rename the Lab2.html file to “your first name_lab2.html” for example “Jim_lab2.html”

The purpose of the lab is to create a proof of concept for a simple logging system that can receive
calls from multiple asynchronous “timers.” We’ll use the JavaScript “setInterval” method to create
timers that can call a function at various times.

Requirements:

Based on the source code listing shown on the next page, notice that we’re starting with:

1. A single global array called “timers.”

2. An IIFE (Immediately Invoked Function Expression) called “log”

3. A function literal called “printFunc” which is a “wrapper” function used to output a string
(followed by a “<br>”) with “document.write.”

4. An “onload” event handler called “startMeUp” which we use to initialize 3 sample timers using
the “setInterval” method. Remember that “setInterval” requires 2 parameters (a function
reference to be called and an interval in milliseconds to define the frequency with which the
function will be called). Also remember that “setInterval” returns a unique integer number that
can be used to perform a “clearInterval” on a specific timer.

In order to complete the lab, you must add some code to the IIFE starting after line 14.

1. Return an anonymous function declaration (see Example #3 – newObject in functions.html).
Your anonymous function should define a single parameter named caller which represents
the particular timer (Timer1, Timer2 etc.).

2. Within the anonymous function declaration, you will have access to all the parameters and
local variables of the parent function. As such, on each invocation:


©2018 Fanshawe College Page 1 of 3 INFO3144, Fall 2018


Downloaded by Abdofa Kech ()

Written for

Institution
Course

Document information

Uploaded on
February 28, 2023
Number of pages
3
Written in
2022/2023
Type
SUMMARY

Subjects

$8.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
faouziabdelmajid

Get to know the seller

Seller avatar
faouziabdelmajid ministry of education
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
3 year
Number of followers
0
Documents
42
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions