Jul 5, 2008 #1 amanbatra Technical User Joined Jul 4, 2008 Messages 4 please tell me the way to use onerror event.. i m following w3schools...but it is not clear there..!! thanx
please tell me the way to use onerror event.. i m following w3schools...but it is not clear there..!! thanx
Jul 5, 2008 #2 Clueful Technical User Joined Sep 2, 2007 Messages 18 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'"> Upvote 0 Downvote
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'">