【问题标题】:FCK Editor not workingFCK 编辑器不工作
【发布时间】:2013-12-17 18:40:03
【问题描述】:
没有为 IE11 加载 FCK 编辑器。这是由于 IE11 的新用户代理。
IE10 也出现了类似的问题,它有以下修复-
var sBrowserVersion = navigator.appVersion.match(/MSIE ([\d.]+)/)[1] ; (参考-FCKEditor doesn't work in IE10)
IE11 也有类似的修复方法吗?
请帮忙。
【问题讨论】:
标签:
internet-explorer
fckeditor
internet-explorer-11
【解决方案1】:
为了解决这个问题(FCKEditor 与 IE11 的兼容性),您必须在生成编辑器实例的相应文件中将 IE 11 检查添加到 FCKEditor。在我们的例子中,这是 fckeditor_php5.php:
else if ( strpos($sAgent, 'Gecko') !== false )
{
// Internet Explorer 11
$iVersion = (int)substr($sAgent, strpos($sAgent, 'rv:') + 3, 2) ;
return ($iVersion >= 11) ;
}
注意:以上内容已添加到函数 FCKeditor_IsCompatibleBrowser() 中。
然后你必须为页面添加 IE 9 或 IE 8 的仿真(IE 10 不适合我们):
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" />
注意:以上内容必须加在head标签内
【解决方案2】:
试试这个:
navigator.appVersion.match(/rv:([\d.]+)/)[1]
由于 IE11 用户代理字符串没有 MSIE 键,因此确切的版本由 rv: 键给出。
【解决方案3】:
我在 safari check 下方的 fckeditor.js 文件底部添加了以下内容
// Safari 3+
if ( sAgent.indexOf( ' applewebkit/' ) != -1 )
return (sAgent.match(/ applewebkit\/(\d+)/)[1] >= 522); // Build must be at least 522 (v3)
// Internet Explorer 11
var sBrowserVersion = navigator.appVersion.match(/Trident\/.+; rv:(\d+)/)[1]
if (sBrowserVersion) {
return (sBrowserVersion >= 10);
}
【解决方案4】:
H Solano 的回答很好,但显然有一个案例是 Ubuntu 下的 Chrome 34 导致 FCK 编辑器验证错误。所以我加了一个小条件:
else if ( strpos($sAgent, 'Gecko') !== false ) {
if (strpos($sAgent, 'Chrome') !== false) {
// Just for Chrome 34 under Ubuntu with a rv: <11
return true;
}
// Internet Explorer 11
$iVersion = (int)substr($sAgent, strpos($sAgent, 'rv:') + 3, 2) ;
return ($iVersion >= 11) ;
}
【解决方案5】:
对我来说同样的问题,
目前我用兼容性视图设置修复了它
【解决方案6】:
为了 FCKEditor,我们使用 META 标签来模拟 IE10。
<meta http-equiv="x-ua-compatible" content="IE=10">
显然这需要在所有其他 META 标记之前。