onerror 事件会在文档或图像加载过程中发生错误时被触发。

案例: 

<img onerror="this.onerror=null;this.src='/images/common/noavatar_medium.gif';" width="121" height="121" src="{CheckInStar.UserPhoto}"/>

 

如果:  src 路径加载错误;则触发 onerror事件 。

相关文章:

  • 2022-12-23
  • 2021-12-22
  • 2021-07-29
  • 2022-02-26
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-04
  • 2022-12-23
  • 2021-12-22
  • 2021-12-13
相关资源
相似解决方案