+ 5
How to skip alt= attribute situation⁉️ HTML <img src= ... alt= ... /> [FIXED]
My code displays random SoloLearn Avatars. But when the generated avatar address is incorrect & the avatar cannot be loaded, the alt= attribute is activated. In this case, I would like to jump to generating a new, correct address and displaying the next avatar. In 🐍 I solved this problem by using: try: except: How to avoid this situation in web code⁉️🤔 I'm not an expert in "The Holy Trinity", HTML+CSS+JS‼️😕 https://code.sololearn.com/WXEmMRkrNa89/?ref=app https://code.sololearn.com/caW7TeDOLM6W/?ref=app
7 Réponses
+ 4
Add onerror="next()" to the image tag
+ 6
ODLNT
You are Genius‼️ onerror='next()' works‼️ Thx a lot‼️☺️
+ 3
ODLNT
Does "download" attribute of hyperlink work in SoloLearn? I tried to wrap the image in a hyperlink with "download" attribute but it opens up the browser instead of allowing the file to be saved ...
https://code.sololearn.com/W0856YcmseVM/?ref=app
+ 3
Ipang According to MDN the download attribute on sololearn app is working as it should, it appears the user must download from a browser instead of the webview.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-download
+ 3
Genius?! ...I'll take it😁. I'm glad I could help.
+ 2
Thank you ODLNT 🙏
- 5
K ckx xkzklo oo lh,ox see lll