• Resolved mediumdeviation

    (@mediumdeviation)


    Hi, first I must thank you for creating such a useful widget.

    However, there are a few things that can be improved. First, the HTML output of the widget isn’t very good. The HTML for each individual image looks something like this:

    <img src="https://scontent.cdninstagram.com/hphotos-xaf1/t51.2885-15/s306x306/e15/11056032_398773203628729_149505156_n.jpg" alt="https://scontent.cdninstagram.com/hphotos-xaf1/t51.2885-15/s306x306/e15/11056032_398773203628729_149505156_n.jpg">

    This is valid HTML, technically speaking, but it fails because the alt attribute is incorrect – as the HTML specs say, alt is suppose to be used to supply an alternative to the image, and the URL of the image certainly isn’t one. You could use the caption, or leave it empty (but not omit the attribute altogether).

    Somewhat related, because the plugin loads a large number of images at once, most browsers cannot load all images at once, and so some (Firefox at least, will test with others) will display the alt text in the meantime. This creates this rather unsightly scene, made worse because of the poor alt text:

    View post on imgur.com

    One way to avoid this is to insert the HTML, then immediately hide the image and add a load event handler to detect when the browser has loaded the image before displaying the image.

    https://ww.wp.xz.cn/plugins/instagram-feed/

Viewing 1 replies (of 1 total)
  • Plugin Author smashballoon

    (@smashballoon)

    Hey mediumdeviation,

    Thanks for calling me out on the image alt issue. I didn’t even realize I had the image set as the alt until you just pointed it out, so thanks for that. I’ll get this fixed in the next update.

    I tested in Firefox and was able to see the problem you referred to. It seems this only occurs on the first page load until the images are cached and so I must have missed it during initial testing. I’ll add some logic to hide the images until they’re loaded as you suggested.

    Thanks again!

    John

Viewing 1 replies (of 1 total)

The topic ‘Suggestion to improve loading and accessibility of images’ is closed to new replies.