Closed FliegendeWurst closed 6 years ago
Its a javascript library that works on the client... That's like saying "This boat doesn't float without water"
What if someone disables javascript?
@FliegendeWurst noscript is your friend...
I think that this is an important point to make — it’s not just a JavaScript library, it’s a custom HTML element, that without JavaScript, has none of the associated behaviours of a standard <img/>
element - e.g. alt attributes.
The Readme suggests you should just use <img-2>
elements in your HTML instead of <img>
elements, then just let the JavaScript do its job, but doesn’t mention any kind of progressive enhancement methods (like noscript tags) for those users with JavaScript disabled. It would be nice to see this covered in the Readme.
It's JS lib. If you have knowledge to use stuff like that, you probably know that, if JavaScript is disabled, you must use <noscript></noscript>
.
We're talking about the obvious here.
And that shows the importance of providing context and submitting a proper bug report. Significantly less stupid sounding with the slightest hint of context.
Although I think it should be obvious to any developer working with a JS library on custom elements - it wouldn't hurt to add a <noscript>
fallback to the examples.
Thank you all for your comments. I think the README should be updated to provides some information regarding this and also suggest the noscript approach. However, I would like to tackle this problem using customized built-in elements instead of the autonomous custom elements it currently uses as this would allow img-2 to basically fallback to a standard img
element as a progressive enhancement 👍
Edit: I'm talking about the example