1
    stages = {
            "1": {
                id: "1",
                div: "foo"
            },
            "2": {
                id: "2",
                div: "bar"
            },
            "3": {
                id: "3",
                div: "foobar"
            }
        };

When I run this in Firefox, it's fine. But when run in IE8, I get this error:

Message: Object doesn't support this property or method

Is this a known bug / is there a workaround or is it my syntax?

13
  • 1
    Have you tried declaring "stages" with var ? Commented Oct 14, 2011 at 15:51
  • No because I want it to be global Commented Oct 14, 2011 at 15:54
  • 2
    I've run the above in IE8 and didn't get an error. Perhaps you just need to wrap you key parts (id, div) in "" as well? Commented Oct 14, 2011 at 15:54
  • And the line number is?? Commented Oct 14, 2011 at 15:56
  • 1
    Are you sure the error isn't coming from a different part of your code? Commented Oct 14, 2011 at 15:56

2 Answers 2

3

If there is an element with id=stages in your markup, some browsers create global variable stages as a reference to it. However, IE doesn't support overriding it without declaring it. If you want stages variable to be global, put var stages; to global scope or assign the object to window.stages.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks man, that's what was wrong. Renamed stages to stagesDict and it works fine.
0

I don't get that error at all. I can define that very code in a javascript file or in the console and it works just fine.

I do see that error if I try and run the code from jsfiddle.net. However the error is referring to code in Action.js and the following code

if (e && e.target.getParent().get('id') == 'm') {

It appears to be unhappy with e.target.

How exactly are you causing that error to popup?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.