zoukankan      html  css  js  c++  java
  • Web Uploader在低版本IE下无法显示Flash的一种情况

    用户反馈在IE 8下无法正常显示Web Uploader控件,并已安装了Flash插件。调试发现在内部抛出了Runtime Error的错误,关键代码如下:

    Runtime.create = function( opts, orders ) {
        var type, runtime;
        
        orders = orders || Runtime.orders;
        $.each( orders.split( /s*,s*/g ), function() {
            if ( factories[ this ] ) {
                type = this;
                return false;
            }
        });
        
        type = type || getFirstKey( factories );
        
        if ( !type ) {
            throw new Error('Runtime Error');
        }
        
        runtime = new factories[ type ]( opts );
        return runtime;
    };

    可以发现是对应的FlashRuntime并未找到。查看源代码发现在注册FlashRuntime时候有一个版本判断,如果没有符合最低版本要求则不注册。查看用户安装的Flash版本确实低于该要求。

    FlashRuntime.register = function( name, component ) {
        component = components[ name ] = Base.inherits( CompBase, $.extend({
        
            // @todo fix this later
            flashExec: function() {
                var owner = this.owner,
                    runtime = this.getRuntime();
        
                return runtime.flashExec.apply( owner, arguments );
            }
        }, component ) );
        
        return component;
    };
        
    if ( getFlashVersion() >= 11.4 ) {
        Runtime.addRuntime( type, FlashRuntime );
    }
  • 相关阅读:
    HDU1312 ZOJ2165 Red and Black
    HDU1312 ZOJ2165 Red and Black
    HDU1181 变形课【DFS】
    codevs1017 乘积最大
    codevs1220 数字三角形
    codevs1169 传纸条
    codevs1219 骑士游历
    codevs1010 过河卒
    codevs1166 矩阵取数游戏
    codevs1154 能量项链
  • 原文地址:https://www.cnblogs.com/junchu25/p/7275009.html
Copyright © 2011-2022 走看看