IE6 problem with push in arrays in jscript

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
 
D

Daniel Crichton

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top