Cannot get property value ____: object is null or undefined

I explored this from this. There are a few posts about this on Stackoverflow, but I have no answer.

Like the other posts here, it works great in Chrome or Firefox. But in IE 9, 8, 7 and 6, I get the same error. I tried to hack when you insert 9 into compatibility mode, but this does not solve the problem.

Speaking Unable to get value of the property 'styleHelper': object is null or undefined , the irony is that if I - in IE 9 - type window.microstrategy.bone("W2552_Ctl").styleHelper in the console, it works and returns the function I need (this identifier was created by WYSIWYG, I do not hate me).

Yes, everything is wrapped in $(document).ready . Yes, no typos. I do not understand why IE hates so much. Any help would be appreciated :)

This code is a simple variable declaration.

var ctlBone = window.microstrategy.bone(targetId + "_Ctl").styleHelper.ctlBone;

It seems like IE is trying to access this object right then and there, rather than assigning it.

+6
source share
3 answers

FINALLY!

This was a problem with setTimeout. Apparently setTimeout(function, miliseconds, param1, param2, param3); breaks down in IE specifically.

SOURCE: http://arguments.callee.info/2008/11/10/passing-arguments-to-settimeout-and-setinterval/

+6
source

I suggest not wrapping the jquery code with the $(document).ready(function(){ . I also ran into the same problem after I commented that $(document).ready(function(){ it works fine In all browsers, including IE 9 8 7.

+2
source

Try setting your browser in compatibility mode - Tools, Compatibility View Settings, and select View all websites in compatibility mode.

+1
source

Source: https://habr.com/ru/post/908448/


All Articles