Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

big_malk

macrumors 6502a
Original poster
Aug 7, 2005
557
1
Scotland
I am working on a site for a client, and have been asked to change the Google ads to a flash banner, that falls back to a gif if the browser isn't using Flash.
I expected to do a two second Google search and find some JS code to do this across all browsers, but I can't seem to find anything like this.

I don't want to spend all day debugging JS on every browser when this seems like such an obvious thing to already be out there, somewhere. Does anyone know where I can get some open source code to do this?

Thanks
 
Not sure about Google ad stuff... but to get an image when flash isn't available, you can use this piece of code:

Code:
<object type="application/x-shockwave-flash
data="yourmovie.swf" 
width="400" height="300">
<param name="movie" 
value="yourmovie.swf" />
<img src="noflash.gif" 
width="200" height="100" alt="" />
</object>

Insert your own path to your swf, the height and width of your swf and path to the image to use instead.

I found it when looking for a way to validate a page with flash on it. Source: A List Apart.
 
Not sure about Google ad stuff... but to get an image when flash isn't available, you can use this piece of code:

Code:
<object type="application/x-shockwave-flash
data="yourmovie.swf" 
width="400" height="300">
<param name="movie" 
value="yourmovie.swf" />
<img src="noflash.gif" 
width="200" height="100" alt="" />
</object>

Insert your own path to your swf, the height and width of your swf and path to the image to use instead.

I found it when looking for a way to validate a page with flash on it. Source: A List Apart.

Thanks, that’s exactly what I needed!
I guess I was looking for an overcomplicated solution, with JS to test for Flash etc.
Do you know if this works across all major browsers?
 
Excellent, glad it's what you were after - wasn't sure if it would be suitable as you mentioned google ads and I'm not overly familiar with their format.

This method should be fine for all common browsers.

Let us know if you have any problems :)

/Doug
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.