I'd love for someone to point out a solution, but I am seeing that images loaded over AJAX in Safari do not render at all if the
srcset attribute is present. I could not get it to work, and found some others with the same issue. The
srcset attribute allows you to define several different sources to be rendered based on the size of the window. It has the potential to be a major asset for web performance.
srcset attribute is a great feature when it works, but it fails in cases that are far from edge-cases in Safari. This basically makes the whole feature useless or flimsy at best.
This post argues that "inconsistent implementations" are a feature and not a bug because it forces "browsers to compete". I'm not sure what's meant by that or if this issue can be traced back to that line of thinking. But if this is the result, I certainly disagree with the approach.
I plan to look into the
<picture> element as a possible replacement. I have no idea yet if it has the same issue. It's generally recommended to "just use
srcset" for most typical use cases. But since that is not implemented properly, moving to
<picture> is a fine solution for my purposes.