Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

CSCI 2910 JavaScript Quiz Part 3 - Prof. David L. Tarnoff, Quizzes of Computer Science

The spring 2007 csci 2910 javascript part 3 quiz. It includes questions about constructors of various objects, properties of image and string objects, and creating an instance of a custom object. It also covers methods like tostring() and getelementbyid().

Typology: Quizzes

Pre 2010

Uploaded on 08/17/2009

koofers-user-p4i
koofers-user-p4i 🇺🇸

10 documents

1 / 1

Toggle sidebar

Related documents


Partial preview of the text

Download CSCI 2910 JavaScript Quiz Part 3 - Prof. David L. Tarnoff and more Quizzes Computer Science in PDF only on Docsity! Spring 2007 – CSCI 2910 JavaScript Part 3 Quiz Name: ________________________________ 1. Below is a list of four objects. From the list, pick only two and describe the arguments (args) that are passed to their constructor functions. Array – Image – String – Date – 2. To change the picture displayed in an Image object, you need to assign a new URL to what property of the Image? 3. Below is the constructor for a custom object called webWindow. In the space below the constructor, write the code to create an instance of webWindow called mywindow that is 600 pixels by 400 pixels with a URL of http://www.xyz.com. (The dimensions are integers while the URL is a string.) function webWindow(url, width, height) { this.webURL = url; this.window_width = width; this.window_height = height; } 4. Most predefined objects have a function called _________ which returns the values or a description of the object in the form of a string that can be output to the client. a.) toString() b.) output() c.) toValues() d.) properties() e.) write() f.) alert() g.) sendString() 5. The keyword ______ is used to identify the current instance being created by the constructor. a.) object b.) isself c.) here d.) getself e.) id f.) this g.) my 6. The property of the String object that returns the number of characters in the string is: a.) length b.) count c.) countof d.) numchar e.) chars f.) index g.) array 7. The code page.prototype.setColor = function(color) is used to: a.) format a new page with a background color of color b.) define a constructor for the object page c.) define a constructor for the object setColor d.) set color of page equal to the value returned by the function function(color) e.) define a function called setColor() for the object page 8. In order to access the object properties and methods of an HTML element, we must declare an object instance that points to that HTML element. This is done with the ________ method. a.) getHTMLObject() b.) getHTMLElement() c.) getWebElement() d.) getElementById() e.) elementToInstance() f.) accessHTMLElement() 9. Convert the following CSS property names to their corresponding JavaScript Property names: font-family border-left-color
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved