我在jsp中这么写
<body>
<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( ) 导致一个问题困扰我很久,我怎么就写了个 呢,无奈。
把 删掉,或者让body的第一个元素为 <span></span> 都是正常的。