Q1. What value does the following JavaScript code fragment store into the variable num?
varnum = localStorage.length;
A. maximum length of a character string
B. potential capacity of local storage
C. number of bytes available in local storage
D. number of key-value pairs in local storage
Answer: D
Q2. When you are working with the path API, what is the purpose of the clip method?
A. pastes a shape object in from the system clipboard
B. constrains the rendered output of the shape object
C. copies the shape object to the system clipboard
D. stores the shape object for later reference in script
Answer: B
Q3. Which element should you use to rotate an SVG square?
A. path
B. ANIMATETRANSFORM
C. ANIMATEMOTION
D. AREA SHAPE
Answer: B
Q4. Which two HTML properties can JavaScript access to change the text value of an HTML element? (Choose two.)
A. innerHTML
B. nodeType
C. title
D. nodeValue
Answer: A,C
Explanation: The innerHTML property sets or returns the inner HTML of an element.
Example:
document.getElementById('myAnchor').innerHTML="Contoso";
The title property sets or returns the element's advisory title.
Example:
var x=document.getElementsByTagName('body')[0];document.write("Body title: " + x.title);
Q5. When content from a flow is loaded into a region, overflowed content:
A. attempts to fit into the region by auto-adjusting the styles.
B. continues into the next region.
C. is truncated and an error flag is set.
D. is buffered for download.
Answer: B
Q6. Which three components define the URL used for localStorage data in HTML5? (Choose three.)
A. scheme
B. user credentials
C. hostname
D. unique port
E. query
Answer: A,C,D
Explanation: localStorage is also the same as globalStorage[location.hostname], with the exception of being scoped to an HTML5 origin (scheme + hostname + non-standard port) and localStorage being an instance of Storage
* HTML5 local storage saves data in string form as key-value pairs. If the data you wish to save is not string data, you are responsible for conversion to and from string when using LocalStorage.
Q7. Which CSS position value is used to position an element relative to the browser window?
A. position: relative;
B. position: absolute;
C. position: static;
D. position: fixed;
Answer: D
Q8. Which JavaScript method allows you to register multiple handlers for a single touch event?
A. dispatchEvent
B. initUIEvent
C. addEventListener
D. initEvent
Answer: C
Q9. When you are using the GeoLocation API, which two arguments does the getCurrentPosition function utilize? (Choose two.)
A. success callback
B. MAC address
C. browser type
D. ip address
E. failure callback
Answer: D,E
Explanation: The getCurrentPosition() method returns an object if it is successful. The latitude, longitude and accuracy properties are always returned.The second parameter of the getCurrentPosition() method is used to handle errors. It specifies a function to run if it fails to get the user's location.
Note:
* The HTML5 Geolocation API is used to get the geographical position of a user.
* The getCurrentPosition() method returns an object if it is successful. The latitude, longitude and accuracy properties are always returned.
Q10. Which are two features of SVG? (Choose two.)
A. uses high performance pixel-based graphics
B. can be modified by using CSS
C. uses high performance raster-based graphics
D. can be modified by using JavaScript
Answer: C,D
Explanation:
Note:
SVG stands for Scalable Vector Graphics
SVG defines the graphics in XML format
SVG graphics do NOT lose any quality if they are zoomed or resized
Every element and every attribute in SVG files can be animated
SVG is a W3C recommendation