html - setting alternative img source -


i have web app written in aspx.

i have img control.

if required image not available alt text message displays.

is there way set 'alt image' instead? img control relies on updates after default period of 10 seconds if no image acquired set default image instead. handy if there property 'alt image'.

i guess use timer check interested in other approaches.

thanks

the onerror attribute can execute js , set new image shown below

<img src="/images/200.png" onerror="this.src='/images/404.png'" > 

Comments

Popular posts from this blog

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -