I am trying to write a JavaScript patch for older browsers. Normally I would begin with some feature-detection code, such as this:
var img=new Image();
if(img.getAttribute('srcset')) … // already support
but I have a problem with browsers which implement the feature in part.
Specifically, I am trying to patch in the srcset attribute. Most modern browsers will report the attribute as being supported, but not all of them support it fully (they support the x property, but not the w property).
Is there a JavaScript method which would detect this?
Thanks