Question No: 131 HOTSPOT – (Topic 3)
You develop a webpage that consumes a web service. The web service provides currency exchange rates. Visitors enter the currency type on the webpage and press the Submit
The web service returns the current exchange rate.
You need to ensure that the webpage always displays the most current information.
How should you complete the relevant code? (To answer, select the appropriate option from each drop-down list in the answer area.)
Use ajax technology (json is for the datatype).
Disable the cache as the most recent data must be displayed.
Question No: 132 – (Topic 3)
You develop a webpage by using HTML5. You create the following markup:
lt;input type quot;urlquot; name= quot;websitequot; required=quot;requiredquot; /gt;
You need to ensure that the value that the user enters contains a secure URL.
What should you do?
Add the following attribute to the input tag: value=quot;https://v
Add the following attribute to the input tag: pattern=quot;https://. quot;
Add the following attribute to the input tag: value=quot;sslquot;
Add the following attribute to the input tag: itemtype=quot;httpsquot;
Answer: B Explanation: Note:
The pattern attribute is supported in Internet Explorer 10, Firefox, Opera, and Chrome.
The pattern attribute specifies a regular expression that the lt;inputgt; element#39;s value is checked against.
The pattern attribute works with the following input types: text, search, url, tel, email, and password
Question No: 133 DRAG DROP – (Topic 3)
You must complete the ShowCanWeAfford() function:
-> Display the message Denied! If the PaymentAmount variable is greater than 500.
-> Display the message Approved! If the PaymentAmount variable is less than 300.
-> Display the message Approved with caution! If the PaymentAmount variable is less than 500 and greater than 300.
Which three actions should you perform in sequence? (Develop the solution by selecting the required code segments and arranging them in the correct order.)
Use gt; for greater than comparison.
Use lt; for less than comparison.
Question No: 134 DRAG DROP – (Topic 3)
You must write a function that returns the sum of the variables named v1, v2, v3, v4. You need to complete the sum function.
How should you complete the relevant code? (To answer, drag the appropriate code segment or segments to the correct location or locations in the answer area. Use only code segments that apply.)
* What is the difference between call and apply?
apply lets you invoke the function with arguments as an array; call requires the parameters be listed explicitly.
Pseudo syntax: theFunction.apply(valueForThis, arrayOfArgs) theFunction.call(valueForThis, arg1, arg2, …)
Question No: 135 – (Topic 3)
You develop a webpage that allows a user to download a JPEG image and convert it to a PNG file.
You need to implement the code to download the contents of the JPEG image with no additional decoding.
Explanation: The readAsArrayBuffer method is used to read a File, Blob, MSStream into memory as an ArrayBuffer object.
Question No: 136 DRAG DROP – (Topic 3)
The function must display loan amounts to the user within the following HTML element:
The loan amount of 2100 must display in the HTML element.
All declared variables and functions must be scoped to the myApp variable. You need to implement the function.
How should you complete the relevant code? (To answer, drag the appropriate code segments to the correct location or locations in the answer area. Use only code segments
Question No: 137 – (Topic 3)
You are developing an HTML5 web application for an architectural company that displays architectural blueprints.
The application must:
-> Display the blueprints at different zoom levels without loss of detail
-> Print the blueprints without loss of detail
-> Work from only one source file per blueprint
You need to ensure that blueprints display according to the requirements. Which HTML5 element should you use?
Explanation: * SVG stands for Scalable Vector Graphics SVG is used to define graphics for the Web
SVG is a W3C recommendation
* The HTML lt;svggt; element (introduced in HTML5) is a container for SVG graphics. SVG has several methods for drawing paths, boxes, circles, text, and graphic images. Reference: HTML5 SVG
Question No: 138 – (Topic 3)
You are developing a web application that can function when users are not connected to the Internet.
You need to check the Internet connectivity status of a user#39;s browser. Which method should you use?
Explanation: Navigator onLine Property
The onLine property returns a Boolean value that specifies whether the browser is in online or offline mode.
Find out whether the browser is online:
var x = quot;Is the browser online? quot; navigator.onLine; The result of x will be:
Is the browser online? true Reference: Navigator onLine Property
Question No: 139 – (Topic 3)
A CSS style sheet must be applied dynamically. The style must visibly change the appearance of the paragraph on the page.
You need to apply a style the paragraph. Which line of code should you use?
document.getElementById(quot;testquot;).style.border = quot;0quot;;
document.getElementById(quot;testquot;).style.position = quot;staticquot;;
document.getElementById (quot;testquot;).style.padding = quot;15pxquot;;
document.getElementById(quot;testquot;).style.top = quot;5pxquot;;
Explanation: The border shorthand property sets all the border properties in one declaration.
The properties that can be set, are (in order): border-width, border-style, and border-color.
It does not matter if one of the values above are missing, e.g. border:solid #ff0000; is allowed.
Reference: Style border Property
Question No: 140 – (Topic 3)
You develop an HTML5 application. You give users a numeric access code that can be used only one time.
Users must enter the numeric access code in the login form of the application. The numeric characters must be hidden by a masking character.
You need to implement the form element for users to enter the code. Which HTML element should you use?
lt;input type=quot;passwordquot; required autocomplete=quot;offquot;gt;
lt;input type=quot;inputquot; autocomplete=quot;offquot; required /gt;
lt;input type=quot;passwordquot; stytemquot; visiblity:hidden;quot; required /gt;
lt;input type=quot;buttonquot; value=quot;passwordquot; required /gt;
Explanation: * Input Type: password
lt;input type=quot;passwordquot;gt; defines a password field.
The characters in a password field are masked (shown as asterisks or circles).
* The autocomplete attribute specifies whether or not an input field should have autocomplete enabled.
The autocomplete attribute works with the following lt;inputgt; types: text, search, url, tel, email, password, datepickers, range, and color.
Reference: HTML Input Types ; HTML lt;inputgt; autocomplete Attribute
|Lowest Price Guarantee||Yes||No||No|
|Free VCE Simulator||Yes||No||No|