Suggestion to improve loading and accessibility of images
-
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
altattribute is incorrect – as the HTML specs say,altis 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
alttext in the meantime. This creates this rather unsightly scene, made worse because of the pooralttext:One way to avoid this is to insert the HTML, then immediately hide the image and add a
loadevent handler to detect when the browser has loaded the image before displaying the image.
The topic ‘Suggestion to improve loading and accessibility of images’ is closed to new replies.