Created
September 17, 2012 22:21
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (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