忽略get或set具有[LenientThis]的属性,因为this对象不正确。 (script.js:3288)
resource:// gre / modules / devtools / server /actors/script.js
我使用的代码是:
var elem = document.getElementById(id); ret ['left'] = Math.round(elem.offsetLeft); //elem.offsetLeft返回null我以前没有看到这样的错误,找不到关于这个问题的任何信息。如果有人可以告诉我,我做错什么会很棒。
解决方案@ felix-king是正确的,这个是一个firefox devtools错误。通常当您检查对象并且打开比正在检查的实例的类型低的基本原型树节点时,会发生这种情况。所以这解释了@ jfriend00在评论中提到的这个错误问题,即使你在代码中没有引用this,检查器也可以。
Is there anybody who can explain the followig error message? I'm trying to get simple informations about mutiple divs while one of them throws this error.
Ignoring get or set of property that has [LenientThis] because the "this" object is incorrect. (script.js:3288)
resource://gre/modules/devtools/server/actors/script.js
The Code i'm using is:
var elem = document.getElementById(id); ret['left'] = Math.round(elem.offsetLeft); //elem.offsetLeft returns nullI haven't seen such an error before and can't find any information about this problem. It would be great if somebody could tell me, what i'm doing wrong.
解决方案@felix-king is correct, this is a firefox devtools errors. It usually happens when you inspect an object and you open a base prototype tree node lower than the type of the instance you are inspecting. So this explains the "this" error problem that @jfriend00 refers to in the comment, even though you don't reference "this" in your code, the Inspector does.
更多推荐
Javascript DOM“这个”对象不正确
发布评论