Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to get hold of onerror event??

Status
Not open for further replies.

amanbatra

Technical User
Jul 4, 2008
4
please tell me the way to use onerror event..

i m following w3schools...but it is not clear there..!!

thanx
 
It would help if you would explain your scenario.
A common use is to provide an alternative image if the original can't be loaded.
Code:
<img src='[URL unfurl="true"]http://someremotesite/pics/353.jpg'[/URL] onerror="this.src='backup.gif'">
A safer version would be:
Code:
<img src='[URL unfurl="true"]http://someremotesite/pics/353.jpg'[/URL] onerror="this.onerror=null;this.src='backup.gif'">
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top