Home  >  Q&A  >  body text

How to load default image on Twitter?

On Twitter, if the image is not loaded, a default image will be displayed. I checked that this is not the background image in the background-image attribute, but img## Pictures introduced with the #tag.

The question is, how does Twitter determine that the image that should be displayed failed to load?

巴扎黑巴扎黑2730 days ago598

reply all(2)I'll reply

  • 怪我咯

    怪我咯2017-05-19 10:29:20

    You should check out Twitter’s developer API. There should be an introduction in it

    reply
    0
  • 大家讲道理

    大家讲道理2017-05-19 10:29:20

    You can use the onerror event of the img tag

    reply
    0
  • Cancelreply