Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript DOM "this" Object is incorrect

Tags:

javascript

dom

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 null 

I 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.

like image 337
BeMoreDifferent.com Avatar asked Nov 26 '14 22:11

BeMoreDifferent.com


1 Answers

@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.

like image 116
rickdog Avatar answered Sep 24 '22 07:09

rickdog