Font size
WorksheetsJavaScript
Total questions: 20
Worksheet time: 12mins
Which code fragment sets up a timer that calls a function named "adjust" every second?
setTimeout(adjust, 1);
setTimeout(adjust, 1000);
setInterval(adjust, 1);
setInterval(adjust, 1000);
Which two functions support 2D transformations in CSS3?
skew()
zoom()
move()
scroll()
matrix()
Which three events are valid for the HTML CANVAS element?
scroll
mouseup
blur
datareceived
hover
Which element should you use to rotate an SVG square?
path
ANIMATETRANSFORM
ANIMATEMOTION
AREA SHAPE
When you are working with the path API, what is the purpose of the clip method?
pastes a shape object in from the system clipboard
constrains the rendered output of the shape object
copies the shape object to the system clipboard
stores the shape object for later reference in script
When you are using the GeoLocation API, which two arguments does the getCurrentPosition function utilize?
success callback
MAC address
browser type
ip address
failure callback
Which JavaScript method allows you to register multiple handlers for a single touch event?
dispatchEvent
initUIEvent
addEventListener
initEvent
You need to ensure the scope of a variable named j is limited to the block of a single function named foo(). Which JavaScript code fragment will accomplish this?
function foo(){
var j;
...
}
var j;
function foo() {
....
}
j=0;
function foo () {
...
}
function foo (){
j=0;
...
}
Which two touch gestures require a multi-touch device?
hold
tap
pinch
spread
What value does the following JavaScript code fragment store into the variable num?
maximum length of a character string
potential capacity of local storage
number of bytes available in local storage
number of key-value pairs in local storage
Which JavaScript method is used to draw a circle on a canvas?
ellipse
circle
bezierCurveTo
arc
Which term describes the canvas API?
xml-based
vector-based
retained-mode
immediate-mode
Which two terms represent interfaces in the File API?
Font
Blob
Keygen
FileList
Which three statements describe cookies?
They can be created, read, and erased using the document.cookie property.
They are limited in size to 5 MB.
They are deleted automatically when the session ends.
They can be used only by pages on the domain where they were set.
They contain the data in the form of a name=value pair
Which three properties can be used with the TouchEvent object in the Safari touch API?
offsetTop
clientHeight
scale
touches
rotation
You create an instance named "location" of a geolocation object.
Which code fragment will initiate periodic updates of a device’s geographic location?
location = navigator.geolocation;
location.watchPosition(showLocation) ;
location.getCurrentPosition(showLocation);
location.clearNatch(watchid);
You need to use JavaScript to access the "section1" element in the following code fragment:
<div id=’section1′>
Which method should you use?
getElementsByTagName
getElementById
getElementsByName
getElementsByClassName
Which two code segments declare JavaScript functions? (Choose two.)
varfunct= (a);
function Foo(a){
…
}
var a=new Foo();
Foo=function(a){…}
On a Windows touch device, which gesture serves the same purpose as a right-click of the mouse?
swipe
pinch
tap
hold
Which three technologies does HTML5 encompass?
CSS
ASP.NET
C#
JavaScript
HTML
