SEO | Link Popularity | Search Engine Consulting | SEO Tutorial | SEO Tools | SEO Forum
Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-27-2004, 07:09 AM
Gnome_101's Avatar
Gnome_101 Gnome_101 is offline
SEO Junior and a half
 
Join Date: Jul 2004
Posts: 93 Gnome_101 is on a distinguished road
Load one image if another doesn't load...does this exist?

Here's what I am looking for. A way in HTML to have a secondary image to load if a first image does not load. Is there code to do this already?

Would a low src work?

If not then I propose a new addition to the scr tag in HTML. W00t!
__________________
Case Management Software
Reply With Quote
  #2  
Old 10-27-2004, 08:43 AM
dilligaf's Avatar
dilligaf dilligaf is offline
SEO GUY Moderator
 
Join Date: May 2004
Location: Tampa Bay
Posts: 2,872 dilligaf has a spectacular aura aboutdilligaf has a spectacular aura about
I can't imagine that there would be. In ASP/PHP you can call for an alternate image if the primary image doesn't exist but even then it wouldn't have anything to do with loading as that is a function of the users machine, connection etc.
__________________
OverSite - A unique web directory for quality sites ONLY.
Reply With Quote
  #3  
Old 10-27-2004, 09:55 AM
Gnome_101's Avatar
Gnome_101 Gnome_101 is offline
SEO Junior and a half
 
Join Date: Jul 2004
Posts: 93 Gnome_101 is on a distinguished road
hmm...

I want to re-rwrite the tag for the src then hehe,...

<img src="<url of primary>","<url of secondary(only if first doesn't load)>">

The hard part would be making the browser resolve that the first image is null, then to load the second.


Hmmm....perhaps I will talk to the Mozilla people.

Thanks dilligaf - I didn't know there were alternate functions for this purpose in Asp/PHP.

I will look into those optoins as well!
__________________
Case Management Software
Reply With Quote
  #4  
Old 06-06-2005, 08:32 AM
Gnome_101's Avatar
Gnome_101 Gnome_101 is offline
SEO Junior and a half
 
Join Date: Jul 2004
Posts: 93 Gnome_101 is on a distinguished road
after learning php, I used the following code to load a seoncdary image if the first one fails to load, or does not exist.

PHP Code:
 $img "../pics/thumbs/{$row['part_numbers']}.jpg";
        
$image_width getimagesize($img);
        if(!
getimagesize($img)) // if image does not exist, replace with secondary
        
{
            echo 
"<td width=\"15%\"><img src=\"slotcars/logos/fly_logo.jpg\"></img>";
        }
        else{ 
// everything is ok, load original image
            
echo "<td width=\"15%\"><img src=\"../pics/thumbs/{$row['part_numbers']}.jpg\"></img>";
        } 
__________________
Case Management Software
Reply With Quote
  #5  
Old 06-08-2005, 08:40 PM
jlknauff's Avatar
jlknauff jlknauff is offline
SEO GUY Moderator
 
Join Date: May 2004
Location: In perpetual style
Posts: 3,312 jlknauff is on a distinguished road
I thought there was (or something similar) but don't remember what it was off the top of my head. Let me know if you still need an answer.
__________________
Wildfire Marketing Forum - Visit our free marketing forum to learn and share tips about marketing.
Reply With Quote
  #6  
Old 06-09-2005, 05:17 PM
Gnome_101's Avatar
Gnome_101 Gnome_101 is offline
SEO Junior and a half
 
Join Date: Jul 2004
Posts: 93 Gnome_101 is on a distinguished road
No thanks,

The code I posted above does what I need. It works like a charm, and I thought perhaps I'd share it with others!


Thanks though!

Warning! If you have a limit on the site of your scripts files (where php errors are thrown), please be mindful that everytime it need to do the logo, it will throw and error
__________________
Case Management Software

Last edited by Gnome_101 : 07-26-2005 at 11:42 AM.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Login/Register
User Name
Password
Remember Me?

Forum Links
Forum Home
SEO Forum
Internet Marketing Forum
Web Design Forum
Web Hosting Forum
Programming Forum
SEO Chat

Quick Links
Forum Home
New Posts
Mark Forums Read
Open Buddy List
User Control Panel
Edit Avatar
Edit Profile
Edit Options
Miscellaneous
Subscribed Threads
My Profile

Search Forums

Advanced Search
All times are GMT -8. The time now is 06:07 AM.


Powered by: vBulletin Version 3.0.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.