IT 3203 Intro to Web Development - Exam 2

IT 3203 Intro to Web Development - Exam 2

memorize.aimemorize.ai (lvl 286)
Section 1

Preview this deck

What is the purpose of the HTML <label> tag? Be very specific.

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

7 years ago

Date created

Mar 1, 2020

Cards (25)

Section 1

(25 cards)

What is the purpose of the HTML <label> tag? Be very specific.

Front

The label tag is used in form data to "label" a text for example.

Back

What does it mean to say a function has a side effect?

Front

A possible side effect for a function is if it is passed more arguments than the function definition, those arguments will be ignored.

Back

Assuming the target page is set up correctly, if the following link is placed on a site's index.html page, what, precisely happens at the browser when the link is clicked? <a href="products.html#phones">Phones</a>

Front

The page will traverse/skip to the "phones" section of the page.

Back

What happens if you do not include a "generic" font name in the font-family property of a style and the computer running the browser doesn't have the specified fonts?

Front

The browser will default to the system default font.

Back

What is the value of variable b after the following JavaScript fragment is evaluated? What is the value of a? Explain why. var a = 6; var b = ++a * 3;

Front

b = 21, a = 7; because a is pre-incremented.

Back

What does the following regular expression match? (Hint:Capital letters are different from lowercase letters in predefined classes.) /\D{3}/

Front

The first 3 Non-Digit characters

Back

In the following HTML fragment, is the path relative or absolute? How do you know? <a href="/definitions/attribute.html">

Front

It is relative because it begins with a /.

Back

For the following code fragment, write in the answer space the JavaScript declaration necessary to declare a new variable, count, make it local to the function, and initialize it to zero. function tester( ) { // What code goes here? }

Front

var count = 0;

Back

An HTML programmer can choose either the GET method or the POST method for sending HTML form data to a Web server. What is the difference? Which one would you choose for an e-commerce site, and why?

Front

POST method sends data to a web server; GET method retrieves data from a server. An E-Commerce site would likely use both "POST a purchase request", GET order total or tracking info

Back

Why should a JavaScript developer not use the document.write ( ) method in an event handler after a page has been loaded?

Front

A JavaScript Developer should not use the document.write() method in an event handler after the page is loaded because it makes an automatic call to the document.open() method.

Back

What are the values returned from a call to the Javascript confirm( ) method? Be specific. (Hint: There are two cases. You must describe them both.)

Front

"OK", which returns true. "CANCEL", which will return false.

Back

Give two examples of default actions of events.

Front

onclick, onsubmit

Back

When would a Web developer use a regular expression? You may answer this question by giving an example if you like.

Front

To parse or search for characters or strings /^base$/ Where is your base located.

Back

Given the following JavaScript, what will be the value of the variable X? (Just name the value.) var stooges=new Array('Curly', 'Larry', 'Moe', 'Shemp'); var X = stooges.shift( );

Front

Curly

Back

JavaScript is designed for event-driven programming. How does the developer make JavaScript react to events? (Example: A form contains <input type="button">. What two things must the developer do to make something happen when the button is clicked?)

Front

He/she must define some action for the button such as alert the user, or display some text, etc...

Back

We said it is always necessary to validate HTML form input on the server for security reasons. Why then would we also want to validate the input on the client before sending the data to the server?

Front

Validating on the client ensures faster processing when submitting to the server.

Back

I and others caution against trying to detect which browser is running one's JavaScript. What can a developer do instead to see whether a specific feature is available at run time?

Front

You can use feature detection to see if an object exists.

Back

Some CSS names contain hypens, for example; background-color. JavaScript must be able to refer to CSS properties, but hyphens are not allowed in JavaScript names. How is this conflict resolved?

Front

By dropping the hyphen and using camelcase instead. backgroundColor

Back

How does the <span> element differ from the <div> element? Be specific.

Front

div element creates a container that can contain other block elements. span is an inline tag to isolate an element.

Back

A Web developer wants the browser to determine the initial position of an element, but wants to move the element later with JavaScript. Which one of the following types of positioning should the developer choose? Static, relative, absolute, fixed. (One word is enough.)

Front

Relative

Back

What is sent to the server if the event handler for the onsubmit event receives a return value of false?

Front

Nothing, the page remains static, and no data is transmitted to the server.

Back

What is the difference between a JavaScript while statement and a do-while statement?

Front

While statement is a pre-test loop; do-while statement is a post-test loop.

Back

What is the value of variable b after the following JavaScript fragment is evaluated? Explain why? a= '2'; b= a * 8;

Front

b = 16, because '2' will be evaluated as a number.

Back

What is the z-index style property used for?

Front

It is used to dynamically replace images.

Back

We discussed three approaches to image replacement, that is, to have one image dynamically replace another after a Web page has been served. Briefly describe the mechanism for any one of them. ("Describe the mechanism" means you must tell me the function, property, or attribute that must be used to make image replacement work. I don't need code, just a description of what the code does.)

Front

Z-index, index=0; Using this function/method in the image properties will allow the images to be "stacked", then using an onclick method will allow traversal.

Back