+ 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 Answers
+ 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