I have a simple JS script to swap out elements containing Flash and replace them with other formats for users who don't have Flash installed.
var hideclass="hidden"
var showclass="empty"
function flashFixMain(){
if (swfobject.hasFlashPlayerVersion("7.0.0")) {
document.getElementById('logoflash').className=showclass;
document.getElementById('logononflash').className=hideclass;
} else {
document.getElementById('logoflash').className=hideclass;
document.getElementById('logononflash').className=showclass;
}
}
And put simply, it doesn't work.
- The if statement works fine - putting an alert in the appropriate place pops up fine.
- I've checked the source of the appropriate page(s) online, and the element name pops up exactly as written (and only once!).
- The class names work fine, as they are used as defaults on the page at the start.
So does anyone have any ideas what I might have missed?