Test Series - html

Test Number 6/72

Q: Which property is used to detect the browser’s user agent and code based on the pertinent cases?
A. navigator.userAgent
B. navigator.user
C. navigator
D. return
Solution: An old strategy was to look at the property navigator.userAgent to detect the browser’s user agent and code based on the pertinent cases.
Q: Some users have requested tests for IE’s float double margin bug, and support for position:fixed. Which API is suitable for them?
A. mq() media Plugin API
B. addTest() Plugin API
C. testAllProps() Plugin API
D. none of the mentioned
Solution: The navigator object contains information about the browser. UseAgent property gives user-agent header sent by browser to the server. A navigator.userAgent is used to detect the browser’s user agent and code based on the pertinent cases.
Q: Which one of the following is not a step to install a library you need to perform the compatibility in browsers?
A. Download the library from the github location
B. Uncompress the file
C. Insert the following code inside the head tag
D. None of the mentioned
Solution: All steps are required.
Q: Which one of the following is an open source JavaScript library that enables styling for HTML5 elements in versions of Internet Explorer before IE 9 ?
A. HTML5
B. HTML5 Shiv
C. HTML5 Shim
D. HTML5 Sham
Solution: HTML5 Shiv is a JavaScript workaround, invented by Sjoerd Visscher, to enable styling of HTML5 elements in versions of Internet Explorer prior to version 9, which do not allow unknown elements to be styled without JavaScript. HTML 5 defines the properties and behaviors of web page content. It is a web language.
Q: ___________ is an open source JavaScript library that allows support for different levels of experiences based on the capabilities of each browser.
A. Navigator
B. Modernizr
C. Geolocation
D. Google API
Solution: Modernizr is an open source JavaScript library that allows support for different levels of experiences based on the capabilities of each browser using a simple feature detection model. Geolocation is the identification of geographic location of an object. The navigator object contains information about the browser. Google API, i.e set of application programming interface which allow communication with Google Services & integration to other services.
Q: ____________ allows you to add custom styles to the document and test an element afterwards.
A. hasEvent()
B. testAllProps()
C. testProp()
D. modernizr.testStyles()
Solution: Modernizr.testStyles() allows you to add custom styles to the document and test an element afterwards. An element with the id of “modernizr” is injected into the page.
Q: Modernizr does actually add missing functionalities to browsers save for the HTML5 tags styling support.
A. True
B. False
C. 1
D. 0
Solution: Modernizr is a JavaScript library which is designed to detect HTML5 and CSS3 features in various browsers, which lets JavaScript avoid using unimplemented features or use a workaround such as a shim to emulate them. Modernizr, in spite of its name, does not actually add missing functionalities to browsers save for the HTML5 tags styling support.
Q: ___________ is used to test whether geolocation is supported in old browsers.
A. Modernizr
B. Modernizr.geolocation
C. Navigator.userAgent
D. Modernizr.js
Solution: Since Modernizr is a JavaScript object with methods, we can use Modernizr.geolocation to test whether geolocation is supported. Geolocation API Detects support for the Geolocation API for users to provide their location to web applications.
Q: ____________ is a resource loader (CSS and JavaScript) that was made to specifically to work side-by-side with Modernizr.
A. HasEvent()
B. Navigator.userAgent
C. Modernizr.load
D. Modernizer.geolocation
Solution: Modernizr.load is optional in your build, but if you are loading polyfills, there’s a good chance it can save you some bandwidth and boost performance a bit. Modernizr.load objects print out on your page in the exact spot they should be, coming after the Modernizr.
Q: In case we want to implement a JavaScript fallback, we would need to create a conditional statement using Modernizr.
A. True
B. False
C. 1
D. 0
Solution: Modernizr is a JavaScript library that detects which HTML5 and CSS3 features your visitor’s browser supports. Modernizer determines whether browser has implemented a given feature. Developers take advantage of new features that browsers support, still create fallbacks for browsers that lack support.

You Have Score    /10