IE crashing with MSG
Came back from holiday yesterday (see the pics!) , to find a stack of emails about problems with MSG crashing IE. This is a bit odd as we’ve not updated MSG for a little while, so strange that it just seems to have started occuring. It seems quite an erratic problem, but it does bring the whole browser down – something I find a little odd for a purely javascript application.
I’m really hoping to get this fixed very soon, but haven’t yet found the root cause, I can reliable recreate the issue, so just need to find why it’s happening.
Plus I need to get my presentation for next weeks OpenLearn conference written sometime soon!
Update (29th Oct)… I have now got the problem resolved, though still don’t know the real root cause. I fixed it by going back through the changes I’ve made recently and seeing at what point the error started occuring.
The change which appears to have been causing the error was when I switched from using <a href=”javascript:….”> to using (what I thought was the proper way!) of adding/removing event listeners. The actual problem occured with the call to detach event, although it didn’t fail everytime – it would work for the first few times and then randomly cause the browser to crash. I did notice that the carsh would only happen if I had the MSG client and the referring site (the one with the users presence icon) open at the same time, if only one was open the crash wouldn’t occur.
For info this was the code that was causing problems:
var oldImg = presenceNode.firstChild;
//remove any current listeners
if(oldImg.removeEventListener){ // Mozilla, Netscape, Firefox
oldImg.removeEventListener('click', launchClick, false);
oldImg.removeEventListener('click', readMessageClick, false);
} else { // IE
oldImg.detachEvent('onclick', launchClick);
oldImg.detachEvent('onclick', readMessageClick);
}
So I replaced this with the code below that just alters the location and title of the link (also a bit of adjusting to add the <a> in):
var oldAnchor = presenceNode.firstChild;
var newAnchor = oldAnchor.cloneNode(true);
newAnchor.href = "javascript:readMessageClick();";
newAnchor.title = MSGAPIconf.str_oneMessageUnread;
So, glad to have got it fixed, but would be even better to know why this was really happening at all!
Update Number 2 (1st Nov) – The fix has now been made live on the MSG-OpenLearn servers.










