HTML APIs Flashcards

1
Q

What is a collection of standards and programming instructions that enable access to a software application?

A

Application Programming Interface (API)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which API is used to render visual images on the fly via scripting?

A

Canvas API

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which element is a transparent container for graphics?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What two attributes does the element have?

A

height and width

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What primitive shape does canvas support?

A

Rectangle

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the standard specifying how objects in a Web document can be referred to and manipulated?

A

Document Object Model (DOM)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which language is used to access HTML elements via the DOM?

A

JavaScript

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which method returns a context object, which provides properties and methods that can be used to draw and manipulate images on a canvas?

A

getContext()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Which methods draws a filled rectangle?

A

fillRect(x,y,width,height)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which method draws a rectangular outline?

A

strokeRect(x,y,width,height)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which methods clears the specified area and makes it fully transparent?

A

clearRect(x,y,width,height)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which method begins a drawing path or resets the current path?

A

beginPath()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which method ends the current drawing path?

A

closePath()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which method moves the pointer to a specified position?

A

moveTo(x,y)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which method draws a curved line with a center, a given radius, a starting and ending angle (in radians), and instruction to draw in a clockwise or counterclockwise direction?

A

arc(x,y,radius,startAngle,endAngle,anticlockwise)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which method draws a straight line from the current drawing position to the specified position?

A

lineTo(x,y)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Which method adds a line to the path drawn?

A

stroke()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Which method fills the area with the color set by the fillStyle property?

A

fill()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Which property sets the fill color or style?

A

fillStyle

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Which property sets the thickness of the path drawn, in pixels?

A

lineWidth

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Which API enables the rendering of interactive 3D and 2D graphics in an HTML canvas without the need for plugins?

A

WebGL API

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

How is WebGL used with the HTML5 element?

A

canvas.getContext(“webgl”)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Which API permits the user to continue working with web sites and documents even when a network connection is unavailable?

A

offline web applications

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What provides a directory on a computer where applications can be stored and run without access to the original application?

A

application cache

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What file provides a list of files needed for a web application to work offline?

A

manifest

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

How do you identify the manifest file to which a web page should link?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

Which API provides the ability to determine a user’s location?

A

geolocation API

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

Which method retrieves the current geographic location of the user?

A

getCurrentPosition()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

Which method retrieves periodic updates about the current geographic location of the user?

A

watchPosition()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

Which method cancels an ongoing watchPosition() call?

A

clearWatch()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

Which API allows a user to grab an object on a computer screen and move it to a different location on the screen?

A

drag-and-drop API

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

Which event specifies where the dragged object can be dropped?

A

dragover

33
Q

Which attribute makes the element draggable?

A

draggable=“true”

34
Q

Which method prevents default action where data elements cannot be dropped in other elements?

A

preventDefault()

35
Q

Which event is called when a page element is dropped after being dragged?

A

drop

36
Q

Which event listener triggers the drag event?

A

ondragstart

37
Q

Which API provides a standard way to interact with files on the client machine using a web browser?

A

File API

38
Q

Which statement is the simplest way to reference several files at once?

A
39
Q

Which interface provides a directory list of file objects? You can list information such as the file name, MIME type, and size?

A

FileList

40
Q

Which interface provides read-only access to individual files, such as images?

A

FileReader

41
Q

What data type is a collection of data stored as a single entity and provides the ability to divide a file into byte ranges?

A

Blob (Binary Large Object)

42
Q

Which API allows you to add, change, and delete URLs and titles in the browser history field?

A

History API

43
Q

Which method sends the browser back one page in the history?

A

history.back()

44
Q

Which method sends the browser forward one page in the history?

A

history.forward()

45
Q

Which method sends the browser forward (positive number) or backward (negative number) the specified number of pages in history?

A

history.go(number)

46
Q

Which method changes the URL in the browser window by adding a URL to the history stack?

A

history.pushState(state object,title,url)

47
Q

Which method replaces the current URL in the history with a new one, instead of adding another URL to the history stack?

A

history.replaceState(state object, title, URL)

48
Q

Why property returns the number of URLs in the history for this browser window?

A

history.length

49
Q

What property returns the state object at the top of the history stack?

A

history.state

50
Q

What property is called when the history changes for a document in the browser window?

A

window.onpopstate

51
Q

What object is used to request data from a web server?

A

XMLHttpRequest

52
Q

How do you create a new XMLHttpRequest object?

A

xmlhttp=new XMLHttpRequest();

53
Q

What technique is used to transmit data between a server and a web application without disturbing page display?

A

AJAX

54
Q

What JavaScript library make it easier to incorporate scripting to your website?

A

jQuery

55
Q

Which jQuery command selects instances of the specified element based on the element name?

A

$(“a”)

56
Q

Which jQuery command selects the elements with the specified ID attribute?

A

$(“#custname”)

57
Q

Which jQuery command selects all elements with the specified class?

A

$(“.demo”)

58
Q

Which jQuery command selects all HTML elements in the document?

A

$(“*”)

59
Q

Which jQuery command selects the current HTML element?

A

$(this)

60
Q

Which jQuery command selects all instances of the specified element with the specified class?

A

$(“a.demo”)

61
Q

Which jQuery command selects the first instance of the specified element on a page?

A

$(“a:first”)

62
Q

Which jQuery command selects all elements with the specified attribute?

A

$(“[href]”)

63
Q

Which jQuery command selects all instances of an element with the specified attribute and value?

A

$(“a[target=‘_blank’]”)

64
Q

Which jQuery command specifies that the code will not run until the document has finished loading?

A

document.ready

65
Q

Which jQuery method sets or returns the text content of selected elements?

A

text()

66
Q

Which jQuery method sets or returns the content of selected elements (including HTML markup)?

A

html()

67
Q

Which jQuery method sets or returns the values of form fields?

A

val()

68
Q

Which jQuery method is used to get and set attribute values?

A

attr()

69
Q

Which jQuery method inserts content a the end of the selected elements?

A

append()

70
Q

What statement selects an HTML element using the ID attribute?

A

document.getElementById(“myLocation”)

71
Q

Which jQuery method inserts content at the beginning of the selected elements?

A

prepend()

72
Q

Which jQuery method inserts content after the selected elements?

A

after()

73
Q

Which jQuery method inserts content before the selected elements?

A

before()

74
Q

Which jQuery method removes the selected element and its child elements?

A

remove()

75
Q

Which jQuery method removes the child elements from the selected element?

A

empty()

76
Q

What statement determines if the browser supports geolocation?

A

if (navigator.geolocation)

77
Q

What statement iterates through a set of files?

A

for (var i = 0, x = files.length; i < x; ++ i)

78
Q

What characteristic of browsers means you do not need to develop multiple versions of your scripts tailored for each browser?

A

all browsers are DOM-compliant

79
Q

What technologies make up HTML5 APIs?

A

HTML5, CSS, and JS