Skip to content

Instantly share code, notes, and snippets.

@patocallaghan
Created September 17, 2012 22:21
Show Gist options
  • Select an option

  • Save patocallaghan/3740143 to your computer and use it in GitHub Desktop.

Select an option

Save patocallaghan/3740143 to your computer and use it in GitHub Desktop.
Check if some object exists before we load it e.g. swfobject (use typeof so it works in oldIE) #js #swfobject #ie8
(function swfEmbed() {
if ( typeof swfobject === 'undefined' ) {
setTimeout( function () { swfEmbed(); }, 100 );
} else {
var vars = { xmlPath: '/RotatorXml', linkCol: '#ffffff' };
var params = {};
var attributes = {};
swfobject.embedSWF( "/flash/HomepageRotator.swf", "rotator-homepage-flash", "796", "428", "9.0.0", "/flash/expressInstall.swf", vars, params, attributes );
}
} )();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment