1.

How can you dispatch a synthetic event object?(a) dispatchEvent()(b) dispatch()(c) dispatch(Event)(d) eventdispatch()I have been asked this question in class test.My enquiry is from JavaScript Benchmarking and Logging with perfLogger topic in division Parsing, Benchmarking and Logging of JavaScript

Answer»

Correct choice is (a) dispatchEvent()

Easy explanation: When you have created and initialized a synthetic event OBJECT, you can dispatch it USING the dispatchEvent() method of EventTarget. The dispatchEvent method throws UNSPECIFIED_EVENT_TYPE_ERR if the event’s TYPE was not specified by initializing the event before the method was called, or if the event’s type is NULL or an empty STRING.



Discussion

No Comment Found

Related InterviewSolutions