1.

Which of the following is used to determine browser support?(a) Modernizr.addTest(b) Modernizr.hasEvent(c) Modernizr.atRule(d) Modernizr.prefixedThis question was posed to me in a national level competition.This question is from Adding HTML features safely with Modernizr in chapter HTML Images & Web Page Files of HTML

Answer»

Right answer is (b) Modernizr.hasEvent

To explain: If you want to create your own FEATURE DETECTS you can simply use Modernizr.addTest. Modernizr.hasEvent helps in determining browser support. It does detection of div element by default. Syntax is hasEvent(‘video’). But if we want to give an object to DETECT SOMETHING other than div, we can give second argument as hasEvent(‘blur’, WINDOW). It also returns a Boolean value. Modernizr.atRule is one of modernizr API(Application Programming Interface) having syntax like – Modernizr.atRule(prop). Modernizr.prefixed Modernizr API takes string CSS value in Document Object Model.



Discussion

No Comment Found

Related InterviewSolutions