IE6 problem with push in arrays in jscript

  • Thread starter Thread starter Daniel Crichton
  • Start date Start date
D

Daniel Crichton

I'm trying to use the ELearning system from MS on my PC, and cannot get it
to work properly. Whether online or offline, I get an "Object doesn't
support method or property" when it's trying to load the viewer. By taking
the jscript include files and dumping them into the offline viewer.htm file
I was able to narrow the error down to the following code:

function ViewerEvents.prototype.ListenForEvents(fHandler,nEvents)
{
if ("function" == typeof(fHandler))
{
var o = new Object();
o.fHandler = fHandler;
o.nEvents = nEvents;
m_aListeners.push(o); <---- this is the line the error occurs on
}
}


Commenting out the line stops the jscript error, but breaks the viewer as it
no longer has event handlers in the array.

I've dug around and discovered that IE5 didn't have the push method for
arrays, but IE6 does. I've also found errors on other sites that use the
push method. It appears that either my script engine has somehow been
downgraded, or a recent IE patch has broken the push method for arrays. Does
anyone have any suggestions as to how I can fix this?

Dan
 
In a fit of inspiration I wrote a bit of jscript to print the version number
of the engine on my PC - it was 5.1. Something must have downgraded it (and
the jscript engine isn't part of the system protected files), so installing
the 5.6 engine from the MS site has fixed the problem :)

Dan
 
Back
Top