HTML5 Online Test Questions part 2

7. In handling media events which event is generated when the first frame of the media has finished loading?

a. loadstart
b. loadeddata
c. ended
d. error

Answer: b. loadeddata

Explanation: The loadeddata event is fired when the first frame of the media has finished loading. This event occurs when data for the current frame is loaded, but not enough data to play next frame of the specified audio/video.


8. Waiting event is generated when the requested operation (such as playback) is delayed pending the completion of another operation (such as a seek)

a. Yes
b. No

Answer: a. Yes

Explanation: Waiting event is generated when the requested operation (such as playback) is delayed pending the completion of another operation (such as a seek). This event is fired when a video stops because it needs to buffer the next frame. Waiting event can also be used on <audio> elements, but it is mostly used for videos.


9. Which method retrieves periodic updates about the current geographic location of the device?

a. getCurrentPosition()
b. watchPosition()
c. clearWatch()
d. All the mentioned above

Answer: b. watchPosition()

Explanation: The watchPosition() method returns the current position of the device and continues to return updated position as the user moves (like the GPS in a car).


10. The following description is given for which data transfer attribute?

a) Returns the kind of operation that is currently selected.
b) This attribute can be set, to change the selected operation.
c) The possible values are none, copy, link, and move.


a. dataTransfer.effectAllowed [ = value ]
b. dataTransfer.dropEffect [ = value ]
c. dataTrnasfer.types
d. dataTransfer.clearData( [ format ] )

Answer: b. dataTransfer.dropEffect [ = value ]

Explanation: The DataTransfer.dropEffect gets the type of drag-and-drop operation currently selected or sets the operation to a new type. The value must be none, copy, link or move. This property controls the feedback (typically visual), the user is given during a drag and drop operation.


11. Which is designed for storage that spans multiple windows, and lasts beyond the current session?

a. Session Stotage
b. Local Storage
c. Both a & b
d. None of the above

Answer: b. Local Storage

Explanation: Local storage is designed for storage that spans multiple windows, and lasts beyond the current session. Local storage object stores the data with no expiration date. The data will not be deleted when the browser is closed, and will be available the next day, week, or year.


12. Which of the following is designed for scenarios where the user is carrying out a single transaction, but could be carrying out multiple transactions in different windows at the same time?

a. Session Storage
b. Local Storage
c. Both a & b
d. None of the above

Answer: a. Session Storage

Explanation: Session storage is designed for scenarios where the user is carrying out a single transaction, but could be carrying out multiple transactions in different windows at the same time. Session storage object stores the data for only one session. The data is deleted when the user closes the specific browser tab.