网络编程 
首页 > 网络编程 > 浏览文章

FCKeditor 在chrome中不显示问题

(编辑:jimmy 日期: 2024/9/19 浏览:3 次 )

网上有人说如下修改就可以,不过也要看你用的是什么系统,程序员的水平就决定了兼容性问题,不过可以试试。

this.EnableSafari = true ; // This is a temporary property, while Safari support is under development.


把false修改为true之后显示正常

应该是chrome使用的内核WebKit的问题,需要修改safari的支持

建议以后广大程序员开发的时候要注意浏览器的兼容性问题。

fckeditor 没显示有问题
没一点格式 参考下吧

<html>
<head> 
<script src=/fckeditor/fckeditor.js"></script>
</head>
<body>
<form action="shou.jsp" method="post" target="_blank"> 
<script>
var editor = new FCKeditor('message');
editor.BasePath='/fckeditor/';
editor.Height=280;
editor.ToolbarSet='Default';
editor.Create();
</script>
<input type="submit" value="提交" name="button">
</form>
</body>
</html>


FCKeditor 没显示,出现空白页面
路劲问题吧 在web.config 里面设置fck的相对路径

<appSettings>
<add key="FCKEditor:BasePath" value="/FCKeditor"/>
<add key="FCKeditor:UserFilesPath" value="/UploadFiles/"/>
</appSettings>

上面的是你Fck所在的相对路径

下面的是fck上传文件的文件夹路径不过今天弄得一个后台由于是老板本,他使用了php判断当前浏览器与版本,chrome下编辑就不会出现的。需要修改一下函数就可以了。

原来的函数

function IsCompatible()
	{
		global $HTTP_USER_AGENT ;

		if ( isset( $HTTP_USER_AGENT ) )
			$sAgent = $HTTP_USER_AGENT ;
		else
			$sAgent = $_SERVER['HTTP_USER_AGENT'] ;

		if ( strpos($sAgent, 'MSIE') !== false && strpos($sAgent, 'mac') === false && strpos($sAgent, 'Opera') === false )
		{
			$iVersion = (float)substr($sAgent, strpos($sAgent, 'MSIE') + 5, 3) ;
			return ($iVersion >= 5.5) ;
		}
		else if ( strpos($sAgent, 'Gecko/') !== false )
		{
			$iVersion = (int)substr($sAgent, strpos($sAgent, 'Gecko/') + 6, 8) ;
			return ($iVersion >= 20030210) ;
		}
		else
			return false ;
	}

修改后的函数

function IsCompatible()
	{
		global $HTTP_USER_AGENT ;

		if ( isset( $HTTP_USER_AGENT ) )
			$sAgent = $HTTP_USER_AGENT ;
		else
			$sAgent = $_SERVER['HTTP_USER_AGENT'] ;

		if ( strpos($sAgent, 'MSIE') !== false && strpos($sAgent, 'mac') === false && strpos($sAgent, 'Opera') === false )
		{
			$iVersion = (float)substr($sAgent, strpos($sAgent, 'MSIE') + 5, 3) ;
			return ($iVersion >= 5.5) ;
		}
		else if ( strpos($sAgent, 'Gecko/') !== false )
		{
			$iVersion = (int)substr($sAgent, strpos($sAgent, 'Gecko/') + 6, 8) ;
			return ($iVersion >= 20030210) ;
		}
		else if ( strpos($sAgent, 'Chrome') !== false )
		{
			return 1;
		}
		else
			return false ;
	}

经过测试这样就正常显示了,解决问题。还有个问题那就是chrome下获取日期不能用getYear,需要用getFullYear(),但也有更好的解决方法,大家可以参考这篇文章。

上一篇:ie9后浏览器fckeditor无法上传图片、弹出浮层内容不显示的解决方法
下一篇:百度编辑器ueditor前台代码高亮无法自动换行解决方法
一句话新闻
高通与谷歌联手!首款骁龙PC优化Chrome浏览器发布
高通和谷歌日前宣布,推出首次面向搭载骁龙的Windows PC的优化版Chrome浏览器。
在对骁龙X Elite参考设计的初步测试中,全新的Chrome浏览器在Speedometer 2.1基准测试中实现了显著的性能提升。
预计在2024年年中之前,搭载骁龙X Elite计算平台的PC将面世。该浏览器的提前问世,有助于骁龙PC问世就获得满血表现。
谷歌高级副总裁Hiroshi Lockheimer表示,此次与高通的合作将有助于确保Chrome用户在当前ARM兼容的PC上获得最佳的浏览体验。
友情链接:杰晶网络 DDR爱好者之家 南强小屋 黑松山资源网 白云城资源网 SiteMap