最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

internet explorer - SCRIPT16389: Unspecified error -- Javascript code - Stack Overflow

programmeradmin0浏览0评论

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.

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?!?

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.

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?!?

Share Improve this question asked Apr 22, 2015 at 15:39 Ray K.Ray K. 2,5113 gold badges25 silver badges40 bronze badges 9
  • 4 put semi-colons after isChild = false and isChild = true – AmmarCSE Commented Apr 22, 2015 at 15:42
  • 1 window.opener is not supported in IE if the opener is in a different security zone. Check your levels of security in IE and see if the problem occurs again. – Ciprian Commented Apr 22, 2015 at 15:46
  • 1 Ciprian: this is a nonissue. This is intranet code, and the window.opener is on the same domain. Also, window.opener is central to the issue I'm working on. – Ray K. Commented Apr 22, 2015 at 15:47
  • @AmmarCSE: ASI (Automatic Semicolon Insertion) makes that totally unnecessary. (Best practice, in my view, but definitely not the problem.) – T.J. Crowder Commented Apr 22, 2015 at 15:48
  • 3 Side note: It's not the problem, but the above can be markedly simplified/shortened: var isChild = window.opener != null; :-) – T.J. Crowder Commented Apr 22, 2015 at 15:48
 |  Show 4 more comments

1 Answer 1

Reset to default 12

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

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.

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.

发布评论

评论列表(0)

  1. 暂无评论