Is there a way to retrieve a
Solution 1:
The <picture>
element is still experimental so I do not think there is an API to get the "active" source yet. I did however find the following issues for the <picture>
spec expecting the element to have a currentSrc
element.
https://github.com/ResponsiveImagesCG/picture-element/issues/223
currentSrc
is the behaviour I also would have expected but currently it is simply not implemented in Chrome or FireFox.
Solution 2:
You can, if you're using jQuery:
$('img').on('load', function() {
console.log($(this)[0].currentSrc);
})
Post a Comment for "