开发者

swfupload not working under IE anymore

开发者 https://www.devze.com 2022-12-19 10:38 出处:网络
http://demo.swfupload.org/v250be开发者_开发技巧ta2/simpledemo/index.php doesn\'t seem to work in IE any more. Is there a fix for this?

http://demo.swfupload.org/v250be开发者_开发技巧ta2/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.


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.


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


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:

  1. Click Start, and then type Internet Explorer in the Start Search box.
  2. Click Internet Explorer (No Add-Ons). Internet Explorer opens without add-ons, toolbars, or plug-ins.
  3. 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

  1. Open Internet Explorer 8.
  2. Click Tools, and then click Manage Add-ons.
  3. On the Show drop-down menu, select All add-ons to display all add-ons that are installed on the computer.
  4. For each item in this list, select the add-on, and then click Disable in the Information window.
  5. When you have disabled all the items in this list, click OK.
  6. Exit and then restart Internet Explorer.
  7. If issues do not reoccur, repeat steps 1 through 3.
  8. Click Enable for a single add-on.
  9. 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."

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号