2

I get this error below only in IE edge. It works in all other browser apart from this one. I want to figure out what is causing this error: enter image description here


Code rather than screenshot:

var ui_tabsets = new Array();

Causing error:

Object doesn't support this action.

Sampson
  • 265,109
  • 74
  • 539
  • 565
Waz
  • 161
  • 1
  • 2
  • 10
  • Can we see the JS code prior to that line? – Drew Kennedy Feb 02 '16 at 12:24
  • It's just initializing other variables: var guar = "GUARFINSTATSLIST"; var period = "FSPERIODENDDATE"; var guarantor = "USEDIRASGUARANTOR"; var guarList = "DIRGUARSLIST"; – Waz Feb 02 '16 at 12:27
  • What's wrong with the literal declaration? `var ui_tabsets = [];` – TRGWII Feb 02 '16 at 12:28
  • Have you tried to initialize `ui_tabsets` like this: `var ui_tabsets = [];` ? In theory is a better practice to use the literal declaration instead of use `new Array();` – gabrielperales Feb 02 '16 at 12:28
  • 1
    It might be that some other script or code before yours is overriding the Array-type... – TRGWII Feb 02 '16 at 12:29
  • Not sure what's going on but creating an array with the `new Array()` syntax works just fine in Edge for me. I would still show the code prior to that line, even if it's just initializing variables. – Drew Kennedy Feb 02 '16 at 12:32
  • Do you have an `id` in your HTML called `ui_tabsets`? – Henrik Andersson Feb 02 '16 at 12:38
  • 2
    "IE edge" is a conflation of two distinct browsers. Are you saying this repros in Microsoft Edge, Internet Explorer, or both? – Sampson Feb 02 '16 at 20:12
  • @Sampson Still waiting for OP's response, but I'm guessing he means IE11 since that's what the title is, IE11 uses Edge document mode, and the [tag:microsoft-edge] tag was added in by Hkachhia, not OP. Either way, not enough info to reproduce this. – TylerH Feb 02 '16 at 20:29
  • 1
    On that note, @Hkachhia please be sure a question is actually related to the tag you're adding when editing tags! – TylerH Feb 02 '16 at 20:30

1 Answers1

0

The error is that the Array constructor cannot be found.. This means something has gone wrong elsewhere. Perhaps you've closed an iframe this was running on or something that's lost you your HttpContext, more often this issue manifests with the error Can't execute code from a freed script. Webkit browsers will create you a new HttpContext if you try to call a function outside of a context and doesn't destroy contexts as eagerly as IE does so this issue probably won't occur in those browsers.

To find out where the problem is, create watches for Array in the debugger and step through the code leading up to this line, at some point you'll notice Array has gone. Work out how/why that line of code is releasing your context.

Dead.Rabit
  • 1,965
  • 1
  • 28
  • 46