How to fix Window.getComputedStyle is not an object error

限于喜欢 提交于 2019-12-04 23:48:16

You are calling init twice. Go through your code and remove one instance.

I received this error testing my project with IE8: finally it was so obvious, this method doen't work with IE 8!

Error: Object doesn't support this property or method at: http://...

I received this error with FF that does support this method but I forgot to change window to my frame window object!

console.log(getComputedStyle(window.document.querySelector('.tip > .tip.top'), ':after').getPropertyValue('left'));
TypeError: Argument 1 of Window.getComputedStyle is not an object.
at: http://...

Note that the above error pops up even if your window object is ok but the querySelector returns nothing! (I suspect it's your case).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!