mOxie未定义,但定义非常明确 [英] mOxie is undefined, yet very clearly defined

查看:133
本文介绍了mOxie未定义,但定义非常明确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在IE9 / 8上拔头发;我正在尝试使用 mOxie ,但它显示为 undefined ,即使它的定义非常明确。

I'm pulling my hair out over IE9/8; I'm trying to use mOxie, but it's showing up as undefined, even though it's very clearly defined.

当从另一个文件中我记录 mOxie 时控制台,它在Chrome / IE10 +中完美记录,但在IE9 / 8日志中触发相同的脚本 undefined

when, from another file, I log mOxie to the console, it logs it perfectly fine in Chrome/IE10+, but firing the same script in IE9/8 logs undefined.

然而,在IE9 / 8中,当我直接在控制台中输入mOxie时,它会正确记录对象。

However, in IE9/8, when I type 'mOxie' in the console directly, it correctly logs the object.

http://jsfiddle.net/vxyayxy8/ - 在IE10模式下运行,你会看到它加载了一个对象。在IE9模式下运行,你会看到它记录 undefined

http://jsfiddle.net/vxyayxy8/ -- Run in IE10 mode, and you'll see that it loads an object. Run in IE9 mode, and you'll see that it logs undefined

为什么它在IE9 / 8中,当从文件(在mOxie之后包含)中记录时,它是 undefined ,但是在直接使用控制台时在IE9 / 8中定义了吗?

Why is it that in IE9/8, when logging from a file (that's included after mOxie), it's undefined, but is defined in IE9/8 when using the console directly?

请记住,它是在Chrome和IE10 +中定义的。

Keep in mind that it's defined in Chrome and IE10+.

在IE11中测试我的答案理论,但在IE9文档模式下,执行 console.log({}) - 我得到 undefined ,这符合问题和答案。你可以重现这个吗?

To test the theory of my answer below, in IE11, but in IE9 document mode, do console.log({}) -- I get undefined, which fits the question and the answer. Can you reproduce this?

推荐答案

下面的答案仍然合法,但显然这是由于IE漏洞导致的我现在已经确定已经修复,所以我正在安装更新并希望最好。谢谢大家的帮助。

我发现在IE8中做 console.log / 9文档模式(是的,devtools打开)导致 undefined

I've discovered that doing console.log in IE8/9 document mode (yes, the devtools are open) results in undefined.

为什么他们将对象记录为undefined超出我的范围,但修复方法是使用 console.dir 哪个结果正确记录对象到控制台。

Why they log an object as undefined is beyond me, but the fix is to use console.dir which results in the correct logging of an object to the console.

mOxie 从未未定义,它只是被记录,通过IE的奇怪的控制台实现。

mOxie was never undefined, it was just being logged as such, through IE's bizarre implementation of the console.

虽然我得到声称无法复制的问题,我仍然可以得到相同的结果,我的测试时间。 http://jsfiddle.net/vxyayxy8/1/ - 显示日志返回未定义的方式, vs dir返回对象。

Though I am getting claims that the issue cannot be reproduced, I can still get the same results,e very time I test it. http://jsfiddle.net/vxyayxy8/1/ -- This shows how log returns undefined, vs dir which returns the object.

这篇关于mOxie未定义,但定义非常明确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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