免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2628 | 回复: 3
打印 上一主题 下一主题

[对象] outlookBar脚本在在ie6不兼容的问题。 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-12-14 22:06 |只看该作者 |倒序浏览
我使用开发的源代码做一个outlookBar的菜单,但是一直报错。我的页面报错如下:
‘document.all.testOpera.style.clip’为空或者不是对象。我检查了其中引入的crossbower.js,发现首先执行这个函数:
function browserType() {
  this.name = navigator.appName;
  this.version = navigator.appVersion;                                //Version string
  this.dom=document.getElementById?1:0                                        //w3-dom
  this.op5=(this.name.indexOf("Opera") > -1 && (this.dom))?1:0         //Opera Browser
  this.ie4=(document.all && !this.dom)?1:0                                   //ie4
  this.ie5=(this.dom && this.version.indexOf("MSIE ") > -1)?1:0             //IE5, IE6?
  this.ns4=(document.layers && !this.dom)?1:0                                   //NS4
  this.ns5=(this.dom && this.version.indexOf("MSIE ") == -1)?1:0 //NS6, Mozilla5

  if (this.ie4 || this.ie5) {
    document.write('<DIV id=testOpera style="position:absolute; visibility:hidden">TestIfOpera5</DIV>');
    if (document.all['testOpera'].style.clip=='rect()') {
      this.ie4=0;
      this.ie5=0;
      this.op5=1;
    }
  }

  this.ok=(this.ie4 || this.ie5 || this.ns4 || this.ns5 || this.op5) //any DHTML
  eval ("bt=this");
}
browserType();
难道这个函数在ie6下边不能使用吗?

[ 本帖最后由 HonestQiao 于 2005-12-15 15:39 编辑 ]

论坛徽章:
1
技术图书徽章
日期:2013-12-05 23:25:45
2 [报告]
发表于 2005-12-15 00:00 |只看该作者
那你报错的具体位置到底是什么呢?

论坛徽章:
0
3 [报告]
发表于 2005-12-15 14:45 |只看该作者
原帖由 HonestQiao 于 2005-12-15 00:00 发表
那你报错的具体位置到底是什么呢?

‘document.all.testOpera.style.clip’为空或者不是对象
if (this.ie4 || this.ie5) {
    document.write('<DIV id=testOpera style="position:absolute; visibility:hidden">TestIfOpera5</DIV>');
    if (document.all['testOpera'].style.clip=='rect()') {
      this.ie4=0;
      this.ie5=0;
      this.op5=1;
    }
  }

论坛徽章:
1
技术图书徽章
日期:2013-12-05 23:25:45
4 [报告]
发表于 2005-12-15 15:39 |只看该作者
那你逐级检查看看是什么出了问题:

document.all['testOpera']
document.all['testOpera'].style
document.all['testOpera'].style.clip
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP