Q1. You are developing a web application that uses web workers to process images extracted from an HTML5 CANVAS object on a web page.
You need to pass messages between the web workers and the web page.
Which three types of objects should you use? (Each correct answer presents a complete solution. Choose three.)
A. JSON
B. Window
C. Parent
D. String
E. JavaScript
F. DOM
Answer: ADE
Q2. You are developing a website that helps users locate theaters in their area from a browser. You created a function named findTheaters ().
The function must:
. Get the current latitude and longitude of the user's device
. Pass the user's location to findTheaters()
The user needs to access the geolocation information from the browser before searching for theaters.
Which code segment should you use?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: C
Q3. You are developing an HTML5 web application for a surveyor company that displays topographic images.
The application must:
Display the topographic images at different zoom levels without loss of detail Print the topographic images without loss of detail Work from only one source file for each topographic image
You need to ensure that the topographic images display according to the requirements.
Which HTML5 element should you use?
A. SVG
B. CANVAS
C. SAMP
D. AREA
Answer: A
Q4. You are creating a custom function. You pass an object named testObj to the function as a parameter. You do not use inheritance through the functions.
The function must establish whether testObj inherits from another object named parentObj.
You need to ensure that the function performs as required.
Which method or operator should you add to the function?
A. parentObj.instanceof(testObj)
B. testObj.isPrototypeOf(parentObj)
C. testObj.instanceof(parentObj)
D. parentObj.isPrototypeOf(testObj)
Answer: B
Q5. You are developing a customer web form that includes the following HTML.
<input id="txtValue" type="text" />
A customer must enter a valid age in the text box prior to submitting the form.
You need to add validation to the control.
Which code segment should you use?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: D
Q6. You troubleshoot a webpage that contains the following HTML markup: (Line numbers are included for reference only.)
The webpage also contains the following JavaScript function named someEvent() that is declared in the HEAD section of the HTML:
Function someEvent() { Alert('someEvent fired!'); }
The JavaScript function named someEvent() must run only when the user clicks the DIV element, not the INPUT elements.
You need to modify the webpage to invoke the JavaScript function named someEvent().
What should you do? (Each correct answer presents a complete solution. Choose two.)
A. Option A
B. Option B
C. Option C
D. Option D
Answer: AB
Q7. You are modifying a blog site to improve search engine readability.
You need to group relevant page content together to maximize search engine readability.
Which tag should you use?
A. <article>
B. <span>
C. <tbody>
D. <cd>
Answer: A
Q8. You are developing a blog web page that is being optimized for accessibility. The page includes the following HTML.
The heading tags represent a blog post title, a blog post subtitle, and the author's name.
You need to ensure that the three headings are treated as a unit but retain their individual formatting.
Which tags should you use to wrap the H1, H2, and H3 elements?
A. <group> </group>
B. <header> </header>
C. <hgroup> </hgroup>
D. <headings> </headings>
Answer: C
Q9. You are developing an HTML5 page that has an element with an ID of logo. The page includes the following HTML.
<div>
Logo:<br>
<div id="logo">
</div>
</div>
You need to move the logo element lower on the page by five pixels.
Which lines of code should you use? (Each correct answer presents part of the solution. Choose two.)
A. document.getElementById("logo") .style.position = "relative";
B. document.getElementByld("logo").Style.top = "5px";
C. document.getElementById("logo").style.top = "-5px";
D. document.getElementById("logo").style.position = "absolute";
Answer: AB
Q10. You are creating a class named Consultant that must inherit from the Employee class. The Consultant class must modify the inherited PayEmployee method. The Employee class is
defined as follows.
function Employee() {}
Employee.prototype.PayEmployee = function ( ){
alertt'Hi there!');
}
Future instances of Consultant must be created with the overridden method.
You need to write the code to implement the Consultant class.
Which code segments should you use? (Each correct answer presents part of the solution. Choose two.)
A. Consultant.PayEmployee = function ()
{
alert('Pay Consulant');
}
B. Consultant.prototype.PayEmployee = function ()
{
alert('Pay Consultant');
}
C. function Consultant () {
Employee.call(this);
}
Consultant.prototype = new Employee();
Consultant.prototype.constructor = Consultant;
D. function Consultant() {
Employee.call(this); }
Consultant.prototype.constructor = Consultant.create;
Answer: BC