Microsoft
Software
Hardware
Network
Question : Replacing broken images (javascript on error in php)
There are some broken images on my site, I would like to replace them with an on error statement and my own image if an image is broken. I have been trying following code but there seems to be some sort of syntax error. Is there a different way?
<?php
...
echo '<a href="'.$n_nearby.'"><img src="'.$img.'" onError="this.src='/images
/error.gif
'" /></a><br />
1: 2: 3: 4:
Original code: <?php ... echo '<a href="'.$n_nearby.'"><img src="'.$img.'" /></a><br />
Answer : Replacing broken images (javascript on error in php)
try this: This will work for you.
$$('img').each(function(el
e){
ele.addEvent('error', function(){
ele.set('src','path to defalut image');
});
});
Hope this helps
Addy
Random Solutions
My Computer prints Very Tiny on Fresh Install
C# DirectoryServices application question
XP runs slow error 0XC000005e,The Security System detected an attempted downgrade attack for server
ironport encryption review
I am new to webservices, please help.
open and read a *.xlsx file
Setting Compatibility Mode in IE8 using JavaScript
jQuery Dialog Ajax PHP problem
Question about Exchange 2010 mailbox move.
office 2003 keeps self installing over 2007