Hey everyone,
I am trying to create an interface to the swfobject found at http://code.google.com/p/swfobject/. I am building the needed alternate content for when the user does not have flash player installed. This is working fine in FF, but not in IE for some reason. I have done this the same way a million times before and it has always worked, I can not figure out why I am getting this error this time.
Basically, when the page loads, it calls a function $.SWFObject.embedSWF() which builds the alternate content, and calls the swfobject.embedSWF function. The alternate content is built with a ready function like the following.
When the setupAlternateContent function is called the error occurs at the ('#' + containerID).
embedSWF: function(flashFilename, containerID, width, height, minFlashVersion, flashvars, params, attributes) {
//If the flashvars, params, or attributes variables were passed in and are objects, then save them, otherwise they will be empty.
settings.flashvars = (flashvars && typeof(flashvars) == 'object') ? flashvars : {};
settings.params = (params && typeof(params) == 'object') ? params : {};
settings.attributes = (attributes && typeof(attributes) == 'object') ? attributes : {};
//Setup the alternate content that will be used if the user does not have flash installed
$(document).ready(function() { setupAlternateContent(containerID); });
//Call the embedSWF function which is found in the swfobject core file
swfobject.embedSWF(flashFilename, containerID, width, height, minFlashVersion, flashUpdater, settings.flashvars, settings.params, settings.attributes);
}
function setupAlternateContent(containerID) {
//Create the innerContainer div element
var innerContainer = $.create('div', {
}).appendTo('#' + containerID).css({
font: '18px Arial, Verdana, sans-serif',
height: '130px',
width: '240px',
paddingTop: '35px',
margin: '0px auto'
});
//Put the flash image inside the innerContainer
$.create('img', {
src: SWFOBJECT_FOLDER_LOCATION + 'flash_icon.png',
alt: 'Install Flash'
}).appendTo(innerContainer).css({cursor: 'pointer'}).click(function() { window.location = 'http://get.adobe.com/flashplayer'; });
//Add a message bellow the flash icon
$.create('p', {}, 'Install Adobe Flash Player').appendTo(innerContainer);
}
IE does not like the ('#' + containerID) argument which does not make any sense because i have done this before without problems. Also, I am using jQuery DOMEC extension which is where the $.create comes from.
Any help is appreciated. Thanks!
Metropolis