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.

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top