Detecting Features with - J Query

You need to attach a special click handler to all anchor tags that have just a hash for the current page, and you don’t want to risk it breaking because of browser support issues.


The object was added in version 1.3 and contains Boolean flags to help write code using browser feature detection. In our example, Internet Explorer (IE) has a different behavior in how it handles the href attribute. IE will return the full URL instead of the exact href attribute. Using the href Normalized attribute, we have future proofed our solution in the event that a later version of IE changes this behavior. Otherwise,we would have needed a conditional that contained specific browser versions.While it may be tempting, it is best to avoid this approach because it requires future maintenance as new versions of browsers are released. Another reason to avoid targeting specific browsers is that it is possible for clients to intentionally or un intentionally report an incorrect user agent string. In addition to the href Normalized attribute, a number of additional attributes exist:

True if the browser renders according to the W3C CSS box model specification
True if style.cssFloatis used to get the current CSS float value
True if the browser leaves intact the results from get Attribute('href')
True if the browser properly serializes link elements with the inner HTML attribute
True if the browser preserves leading whitespace when inner HTML is used
True if the browser does not clone event handlers when elements are cloned
True if getElementsByTagName('*') on an element returns all descendant elements
True if the browser can interpret the CSS opacity style
True if using appendChildfor a <script>tag will execute the script
True if getAttribute('style') is able to return the inline style specified by an element
True if the browser allows <table>elements without a <tbody>element

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

J Query Topics