Problem Description:
problem: the SRC picture in img tag failed to load, and a fragment icon will appear in the original picture position, which is very unpleasant. How to be more beautiful font>
Cause analysis:
because the reverse display resource cannot be found or the path does not exist, it will be processed according to the IMG default processing method font>
Solution:
1. Find a default picture to replace
2. Trigger with onerror event
3. The oneror event is triggered repeatedly
<img src="url" onerror= "this.οnerrοr='';this.src='static/images/nop.svg'">
Can be solved
Read More:
- JS exception capture: the usage and example analysis of onerror() in window
- python keyerror(0)
- Android solution to the conflict of calling ontouch and onclick at the same time
- JQ adds a click event to the option of select
- How to increase the effect of onchange event after adding readonly attribute to input tag and display time of laydate plug-in
- [QT] solve the problem that the trigger of QPushButton cannot trigger setvisible
- PHP uses timthumb to generate thumbnails
- Python combined with Matplotlib to add button
- The problem of cursor skipping in wangeditor
- Ueditor paste word image and upload image file automatically
- Solution of no response of progress bar in MFC program
- About Android studio error: (26,13) failed to resolve: com.android.support : appcompat-v7:27. + error
- (springmvc) Failed to load resource: the server responded with a status of 404 (Not Found)
- How to restrict input field to only input pure numbers in HTML
- When to enter success and error in AJAX
- ORA-04098: trigger ‘SYS.GGS_DDL_TRIGGER_BEFORE’ is invalid and failed re-validation
- OTS parsing error: invalid version tag
- plt.show () and plt.imshow The difference between ()
- Eclipse report error Error:opening registry key ‘Software/JavaSoft/JRE’
- Pytorch torchvision.datasets.ImageFolder Found 0 files in subfolders error for