用Ext时被一个问题困扰了很久

 

我在jsp中这么写

<body>

   &nbsp;

  <div id="grid-panel"></div>

</body>

 

 

9行,var range = el.ownerDocument.createRange();  报:对象不支持些属性或方法

 

这个问题导致我的grid在单击列头时弹出的菜单无法应藏,怎么也找不出原因。

 

去官网论坛查了一下发现 是 IE兼容的问题,下面是老外的原话:

 

This is an issue in IE where the first element of the body can't be a text node. A simple workaround is to place an empty span (or any tag) as the first child until we find a suitable workaround.
就因为body的第一个子元素是textNode( &nbsp;) 导致一个问题困扰我很久,我怎么就写了个 &nbsp;呢,无奈。
把 &nbsp;删掉,或者让body的第一个元素为 <span></span> 都是正常的。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值