415 how does (Unsupported Media Type) intercept the loading of images?

GET https://cnbj2.fds.api.xiaomi. 415 (Unsupported Media Type)

failed to load the page-side request avatar. I want to block the return. If 415 is returned, the local default avatar will be loaded, and the avatar will not be loaded frequently. How to do this intercept? -sharp-sharp-sharp problem description

the environmental background of the problems and what methods you have tried

related codes

/ / Please paste the code text below (do not replace the code with pictures)

what result do you expect? What is the error message actually seen?

Apr.02,2021

onerror can't use this directly. Only if the image fails to load, the default picture will be displayed


pictures all adopt lazyload so that it is possible to handle the failure of the request

.
Menu