cftextarea richtext编辑器无法在IE10中运行

时间:2013-03-15 18:43:33

标签: coldfusion internet-explorer-10 fckeditor

我在IE10中遇到<cftextarea>richtext="true"的问题。问题是<cftextarea>使用的FCK编辑器似乎与IE10不兼容。

使用CK编辑器(这将是我的第一选择)重做这将是一项巨大的工作。有谁知道如何强制内置的ColdFusion富文本编辑器与IE10兼容?

我已尝试编辑fckeditor.jsfckutils.cfm文件,以便使用两位数来考虑IE10版本号。但是,这些文件似乎没有被我正在使用的cftextarea实例拾取/使用。但是,fckeditor.html文件正在被命中。

我对fckeditor.js所做的更改:

// Internet Explorer 5.5+
if ( /*@cc_on!@*/false && sAgent.indexOf("mac") == -1 )
{
    //var sBrowserVersion = navigator.appVersion.match(/MSIE (.\..)/)[1] ;
    var sBrowserVersion = navigator.appVersion.match(/MSIE ([\d.]+)/)[1] ;
    return ( sBrowserVersion >= 5.5 ) ;
}

我在fckutils.cfm中所做的更改

// check for Internet Explorer ( >= 5.5 )
if( find( "msie", sAgent ) and not find( "mac", sAgent ) and not find( "opera", sAgent ) )
{
    // try to extract IE version
    stResult = reFind( "msie ([0-9]+\.[0-9]+)", sAgent, 1, true );
    if( arrayLen( stResult.pos ) eq 2 )
    {
        // get IE Version
        sBrowserVersion = mid( sAgent, stResult.pos[2], stResult.len[2] );
        if( sBrowserVersion GTE 5.5 )
            isCompatibleBrowser = true;
    }
}

对于cftextarea FCK编辑器实例,我应该在某处进行任何其他更改吗?

2 个答案:

答案 0 :(得分:1)

我通过在coldfusion中使用ajaxonload()函数解决了这个问题。

答案 1 :(得分:0)

我完全无法在CF9中使用IE 10。我尝试了你建议的更改,但IE10上还有其他一些JavaScript错误。

问题是CF正在使用旧版CKEditor(仍然使用原始名称FCKEditor)。您可能想尝试下载最新版本的CKEditor并在项目中使用它们。这就是我所做的,我发现它很容易实现。基本上,您只需在脚本标记中包含ckeditor.js,然后为任何<textarea>标记提供class="ckeditor"属性,并且该库会为您处理其他所有内容。

如果使用通用组件生成文本字段,显然这会容易得多。如果您在整个地方都有随机<cftextarea>标记,则必须进行更大规模的搜索/替换。

您也可以尝试在CFIDE中更新库,但这可能会导致更多问题而不是值得。