250+ TOP MCQs on HTML APIs and Answers

Javascript Multiple Choice Questions on “HTML APIs”.

1. Which program code doesn’t need preprocessing before being run?
a) Text
b) Script
c) Both Text and Script
d) Comment
Answer: b
Clarification: A scripting or script language is a programming language for a special run-time environment that automates the execution of tasks. A script is program code that doesn’t need pre-processing (e.g. compiling) before being run.

2. What is the significance of scripting?
a) Convenient
b) Dynamic
c) Reachable
d) Modular
Answer: b
Clarification: Scripting languages are often interpreted (rather than compiled). Scripting makes Web pages more dynamic) For example, without reloading a new version of a page it may allow modifications to the content of that page, or allow content to be added to or sent from that page. The former has been called DHTML (Dynamic HTML), and the latter AJAX (Asynchronous JavaScript and XML).

3. What is the purpose of XMLHttpRequest?
a) Multiple loading
b) Load content by loading new document
c) Load content without loading new document
d) Repetitive loading
Answer: c
Clarification: The XMLHttpRequest object can be used to request data from a web server. XMLHttpRequest makes it possible to load additional content from the Web without loading a new document, a core component of AJAX.

4. Which API makes the user’s current location available to browser-based application?
a) Java API
b) SDL API
c) Object API
d) Geolocation API
Answer: d
Clarification: The Geolocation API allows the user to provide their location to web applications if they so desire. For privacy reasons, the user is asked for permission to report location information.

  250+ TOP MCQs on Shorthand functions and Multiple catch clauses and Answers

5. Which of the following ensures additional interactivity mechanism?
a) WAI ARIA
b) Geolocation API
c) Object API
d) SDL API
Answer: a
Clarification: Web Accessibility Initiative – Accessible Rich Internet Applications (WAI-ARIA) is a technical specification published by the World Wide Web Consortium (W3C) that specifies how to increase the accessibility of web pages, in particular, dynamic content, and user interface components developed with Ajax, HTML, JavaScript, and related technologies. WAI ARIA offers mechanisms to ensure that this additional interactivity remains usable independent of devices and disabilities.

6. What is the necessity to have API?
a) Guide to performing activities
b) Describe particular task
c) Both performing activities and Describe particular task
d) Rearrangement of tasks
Answer: b
Clarification: In computer programming, an application programming interface is a set of subroutine definitions, communication protocols, and tools for building software. An API may describe the ways in which a particular task is performed.

7. What is the purpose of the event onAirEvent?
a) Content is played
b) Content is transferred
c) Both Content is played and transferred
d) Content is changed
Answer: a
Clarification: The event onAirEvent is fired when the player starts playing content being broadcasted on the channel. The method is called at the time of the creation of adspace.

8. What is the purpose of the event disconnectionEvent?
a) Player demands for disconnection
b) Player disconnects from the channel
c) There is no user interaction
d) Player demands for reconnection
Answer: b
Clarification: navigator.onLine is a property that maintains a true/false value (true for online, false for offline). This property is updated whenever the user switches into “Offline Mode”. The event disconnectionEvent is fired when the player disconnects from the channel, whether a result of user interaction or not.

  250+ TOP MCQs on Client-Side JavaScript and Answers

9. When does one use the event ready?
a) Before loading
b) During loading
c) After loading
d) During reloading
Answer: c
Clarification: The ready event occurs when the DOM (document object model) has been loaded. It is safe to interact with it after this event fired.

10. When does one use the method startOverlays()?
a) Edit ad request
b) Delete ad request
c) Create ad request
d) Modify ad request
Answer: c
Clarification: A new ad request is made every time when the method startOverlays() gets called. It is used at the time of creation of the ad.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top