>  Q&A  >  본문

javascript - 在IE8用$.jgrid.gridUnload('id')报错,连hasOwnProperty不能使用

在IE8用$.jgrid.gridUnload('id')报错,dispHTMLTable类型,连hasOwnProperty不能使用

用typeOf(c)得到的是object

天蓬老师天蓬老师2721일 전427

모든 응답(1)나는 대답할 것이다

  • ringa_lee

    ringa_lee2017-04-11 12:04:12

    因为某种原因Object.prototype。hasOwnProperty实际上是在IE8中定义,但不携带到DOM元素(其他的元素可以使用)。所以不能使用。把直接判断DOM元素对象的c.hasOwnProperty(f[d])换成c[f[d]] !== undefined就行。github是个好东西,百度半天的东西在github上一下就解决了。

    회신하다
    0
  • 취소회신하다