当前位置: 代码网 > it编程>前端脚本>网页编辑器 > FCKeditor 在chrome中不显示问题

FCKeditor 在chrome中不显示问题

2024年05月18日 网页编辑器 我要评论
网上有人说如下修改就可以,不过也要看你用的是什么系统,程序员的水平就决定了兼容性问题,不过可以试试。this.enablesafari = true ; // this is a temporary

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

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(),但也有更好的解决方法,大家可以参考文章。

(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com