IE 11 - console.log显示未定义的对象属性 [英] IE 11 - console.log is displaying undefined for object properties

查看:109
本文介绍了IE 11 - console.log显示未定义的对象属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个非常简短的例子。我将下面的代码复制并粘贴到文件中,保存并打开它。在Chrome中工作正常,在11中失败。

This is a pretty short example. I copy and paste the code below into a file, save it, and open it. Works fine in Chrome, fails in ie 11.

控制台上的输出是无稽之谈!
发生了什么事?偶然发现了一些奇怪的错误?

The output on the console is nonsense! What's going on? Have a stumbled upon some strange bug?

test.b显然没有未定义,因为它可以通过JSON解析器和直接对象评估来访问。

test.b is clearly not undefined, as it is accessible by the JSON parser and by direct object evaluation.

此外,在日志函数中切换变量的顺序不会改变test.b未定义。

Also, switching around the order of the variables in the log function does nothing to change test.b being undefined.

<!DOCTYPE html>
<html>
<head>
   <title>wtf</title>
   <script>
      var test = {a:1,b:{c:1}}
      console.log(test,JSON.stringify(test),test.b);
    </script>
</head>
<body>
    WTF IE
</body>
</html>

推荐答案

微软已接受错误报告。

http://connect.microsoft.com/IE/feedbackdetail/view/958116/console-log-bug-on- 11-0-9600-17239-displays-undefined-undefined-for-objects-and-arrays-are-are-properties-of-objects

所以答案似乎是,这是一个错误。

So the answer appears to be, at this time, that it's a bug.

这篇关于IE 11 - console.log显示未定义的对象属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆