问题
http://demo.swfupload.org/v250beta2/simpledemo/index.php doesn't seem to work in IE any more. Is there a fix for this?
I get a red cross instead and the 'button' is not clickable.
I'm running IE 8.
回答1:
I could reproduce the problem with IE9 running on Windows 7, but only on virtual machines. Anyway, I was able to apply a quick'n'dirty to fix the problem by patching swfupload.js (v2.2.0), somewhere around line 230, thanks to this post.
SWFUpload.prototype.getFlashHTML = function () {
// Flash Satay object syntax: http://www.alistapart.com/articles/flashsatay
// ADD THESE LINES -->
var iefix = '';
if(navigator.userAgent.search(/MSIE/) > -1){
iefix = 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
}
// MODIFY THIS LINE: (add ' + iefix + ')
return ['<object ' + iefix + ' id="', this.movieName, '" type="application/x-shockwave-flash" data="', this.settings.flash_url, '" width="', this.settings.button_width, '" height="', this.settings.button_height, '" class="swfupload">',
'<param name="wmode" value="', this.settings.button_window_mode, '" />',
...
Seems that a very similar fix might help for 2.5.0.
EDIT: it seems that this fix wasn't enough for some VM's that have an IE add-on called "VMware Adobe Flash Optimizer" enabled. For some reason, the optimizer turns the Flash movie to a white box (which is actually clickable if you know to click it).
The bad news is that I found no way to detect or disable the presence of the optimizer add-on in my code. So I can't be sure whether the user actually sees the button or only a white box. I found no good workaround, only added a fallback link to a non-Flash uploading form.
回答2:
It is not only you who has the problem. It is also on the swfuploader website itself. Take a look: http://demo.swfupload.org/v220/simpledemo/index.php
回答3:
You may have an add-on that is getting in the way. Try running IE 8 in "No Add-Ons" mode. From http://support.microsoft.com/kb/936213:
"Method 3: Run Internet Explorer in "No Add-Ons" mode
Internet Explorer add-ons, such as ActiveX controls and browser toolbars, are used by some Web sites to provide an enhanced browsing experience. An error may occur if an add-on is damaged or if an add-on conflicts with Internet Explorer. To determine whether the error is caused by an add-on, run Internet Explorer in "No Add-Ons" mode. To do this, follow these steps:
- Click Start, and then type Internet Explorer in the Start Search box.
- Click Internet Explorer (No Add-Ons). Internet Explorer opens without add-ons, toolbars, or plug-ins.
- Test Internet Explorer to verify that it works correctly. If issues still occur, try Method 4.
If no errors occur, the problem is caused by one of the add-ons that typically load together with Internet Explorer. In this case, use one of the following options.
Option 1: Reset Internet Explorer
Reset Internet Explorer to its default configuration. This step will also disable any add-ons, plug-ins, or toolbars that are installed. Although this solution is quick, it also means that, if you want to use any of those add-ons in the future, they must be reinstalled. To reset Internet Explorer settings, use Method 4.
Option 2: Use the Manage Add-ons tool to determine which add-on is causing the issue
Use the Manage Add-ons tool in Internet Explorer to individually disable each add-on to determine which add-on is causing errors. To do this, follow these steps:
Internet Explorer 8
- Open Internet Explorer 8.
- Click Tools, and then click Manage Add-ons.
- On the Show drop-down menu, select All add-ons to display all add-ons that are installed on the computer.
- For each item in this list, select the add-on, and then click Disable in the Information window.
- When you have disabled all the items in this list, click OK.
- Exit and then restart Internet Explorer.
- If issues do not reoccur, repeat steps 1 through 3.
- Click Enable for a single add-on.
- Repeat steps 6 through 8 until you determine which add-on causes errors to occur.
After you have used this process to determine which add-on is causing errors, you can disable that add-on. Or, you can uninstall the software that installs the add-on. We also recommend that you contact the software vendor that provided the add-on for additional troubleshooting and support."
来源:https://stackoverflow.com/questions/2204871/swfupload-not-working-under-ie-anymore