SCRIPT16389:未指定的错误 - Javascript 代码

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29802481/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-23 04:01:22  来源:igfitidea点击:

SCRIPT16389: Unspecified error -- Javascript code

javascriptinternet-explorer

提问by Ray K.

I'm getting a "SCRIPT16389: Unspecified error" for simply defining a small piece of Javascript. This thing works in all browsers EXCEPT IE (yeah, freaking IE -- don't get me started). I am testing this in IE10, but I was told that this is also happening in IE11.

我收到一个“SCRIPT16389:未指定的错误”,因为我只是定义了一小段 Javascript。这东西适用于除 IE 之外的所有浏览器(是的,该死的 IE - 不要让我开始)。我正在 IE10 中对此进行测试,但有人告诉我这也在 IE11 中发生。

This is all I have in my code where it's failing (!!!):

这就是我的代码中所有失败的地方(!!!):

<script type="text/javascript">
    var isChild;
    if (window.opener == null) { isChild = false } else { isChild = true }
</script>

I've looked at other posts that have this same error. None of them answers my question.

我看过其他有同样错误的帖子。他们都没有回答我的问题。

Ideas, anyone?!?

想法,有人吗?!?

采纳答案by Ray K.

I have since discovered that IE spits out this generic error if it doesn't like a piece of Javascript code.

我后来发现,如果 IE 不喜欢一段 Javascript 代码,它会吐出这个通用错误。

I don't remember specifically what the Javascript issue was for this question, but I do remember that once I resolved it, this error went away.

我不记得这个问题的 Javascript 问题是什么,但我记得一旦我解决了它,这个错误就消失了。

EDIT:I seem to keep getting downvotes on this, so let me clarify what I'm talking about. What I'm saying is that a Javascript error -- ANY Javascript error, not something specific -- will cause the SCRIPT16389 error to appear. If you resolve the error -- whatever it is you're getting -- then the SCRIPT16389 should disappear.

编辑:我似乎一直在反对这一点,所以让我澄清一下我在说什么。我要说的是 Javascript 错误——任何 Javascript 错误,而不是特定的错误——都会导致出现 SCRIPT16389 错误。如果您解决了错误——无论您得到了什么——那么 SCRIPT16389 应该会消失。