NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Hide Dead Images with Javascript

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 08-08-2007, 07:03 AM THREAD STARTER               #1 (permalink)
Senior Member
Join Date: Aug 2004
Location: by the beach
Posts: 1,104
onewordonly is a glorious beacon of lightonewordonly is a glorious beacon of lightonewordonly is a glorious beacon of lightonewordonly is a glorious beacon of lightonewordonly is a glorious beacon of light
 



Hide Dead Images with Javascript


Hello,
I have a page the gets images from a 3rd party and I want to use a script that will hide images that are not working. This site is not using php so I thought Javascript would be good.

I can't seem to find anything?
__________________
Domain Name Coupon Codes for popular registers including:
Domain name coupons - GoDaddy.com Coupons - Hosting Coupons ... more
onewordonly is offline  
Old 08-08-2007, 01:44 PM   #2 (permalink)
Senior Member
 
Xyzer's Avatar
Join Date: Aug 2005
Location: United Kindom
Posts: 1,502
Xyzer is a name known to allXyzer is a name known to allXyzer is a name known to allXyzer is a name known to allXyzer is a name known to allXyzer is a name known to allXyzer is a name known to allXyzer is a name known to all
 


Tsunami Relief AIDS/HIV
Hmm.. I'm not entirely sure if this is possible with Javascript, becuase it is a client side language. You could do with something server side like a cron job that say every hour would check the links and then if they do not exist or something.. delete them from the database, assuming you are using one..
Xyzer is offline  
Old 08-08-2007, 11:39 PM THREAD STARTER               #3 (permalink)
Senior Member
Join Date: Aug 2004
Location: by the beach
Posts: 1,104
onewordonly is a glorious beacon of lightonewordonly is a glorious beacon of lightonewordonly is a glorious beacon of lightonewordonly is a glorious beacon of lightonewordonly is a glorious beacon of light
 



ok I see, well it is on a database with ASP this site, just a very small site using an access database which is updated once a week.... But I do have this problem with other sites that use PHP & MySql when I use merchant datafeeds and there is often broken images in the datafeed. Yes I think I know what your getting at, I might have to come up with something that looks up the images in the database.
__________________
Domain Name Coupon Codes for popular registers including:
Domain name coupons - GoDaddy.com Coupons - Hosting Coupons ... more
onewordonly is offline  
Old 08-09-2007, 04:55 AM   #4 (permalink)
NamePros Regular
Join Date: Oct 2003
Location: Sweden
Posts: 395
cerebus has a spectacular aura aboutcerebus has a spectacular aura about
 


Animal Rescue Wildlife Animal Cruelty
I think onerror should work for that, did it a quick run in FF2 and IE6/7 and seems to work there at least:
Code:
<img src="imglink.jpg" onerror="this.style.display='none'">
Checking them serverside is probably a better idea though.
cerebus is offline  
Old 08-09-2007, 09:20 AM THREAD STARTER               #5 (permalink)
Senior Member
Join Date: Aug 2004
Location: by the beach
Posts: 1,104
onewordonly is a glorious beacon of lightonewordonly is a glorious beacon of lightonewordonly is a glorious beacon of lightonewordonly is a glorious beacon of lightonewordonly is a glorious beacon of light
 



Originally Posted by cerebus
I think onerror should work for that, did it a quick run in FF2 and IE6/7 and seems to work there at least:
Code:
<img src="imglink.jpg" onerror="this.style.display='none'">
Checking them serverside is probably a better idea though.
hey that is perfect & exactly what I'm looking for, thanks a lot & I have given you rep points. It also works with this in FF 1.07 & IE 6.1
__________________
Domain Name Coupon Codes for popular registers including:
Domain name coupons - GoDaddy.com Coupons - Hosting Coupons ... more
onewordonly is offline  
Old 08-10-2007, 02:52 AM   #6 (permalink)
NamePros Member
 
guillermobt's Avatar
Join Date: Sep 2005
Posts: 160
guillermobt is on a distinguished road
 



Simple and effective. Nice code cerebus
guillermobt is offline  
Old 08-11-2007, 09:44 AM   #7 (permalink)
NamePros Regular
 
DylanButler's Avatar
Join Date: Jan 2006
Location: San Diego, CA
Posts: 735
DylanButler is a splendid one to beholdDylanButler is a splendid one to beholdDylanButler is a splendid one to beholdDylanButler is a splendid one to beholdDylanButler is a splendid one to beholdDylanButler is a splendid one to beholdDylanButler is a splendid one to beholdDylanButler is a splendid one to behold
 



onerror! thats one you dont see every day.
DylanButler is offline  
Old 08-11-2007, 10:43 AM   #8 (permalink)
NamePros Regular
 
Marck's Avatar
Join Date: Jun 2007
Posts: 735
Marck is a glorious beacon of lightMarck is a glorious beacon of lightMarck is a glorious beacon of lightMarck is a glorious beacon of lightMarck is a glorious beacon of light
 



Is there some reason alt tags wont work here??
__________________
8^X
Marck is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 08:12 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger