Question

I have a big problem in front of me. I have to build soft that works on every modern browser and... IE8. Internet explorer can't see variables declared before function.

Model.something = function() {
  var someVariable = "something";
  (...)
  function process(err, data) {                 
    console.log(someVariable);     //internet explorer can't see this variable
  };
};

In every browser even in documentation I have, that JS see variables declared before. In IE8, this rule doesn't exist, anyone have any simple ideas? Any help will be much appreciated.

Était-ce utile?

La solution

IE8 isn't complaining about someVariable. It's complaining about console, which is undefined in IE8. See this question for more details.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top