IE Oddities

I recently ran into an extremely frustrating glitch with some web pages I was working on. To spare myself more repetition, below is the description of the problem that I almost posted to a Google Group in search of an answer as I had run out of ideas:

I have an extremely strange issue with a page I'm working on. For some reason, on this one machine that I remote into, the inline event handlers inside a particular table fail to work. I know the ideal thing here is to get rid of them and go with DOM level 2 but that would take some considerable effort and I really need a short term solution at the moment. This problem only happens on one particular machine (just so happens the one people have to use) that we'll name "Weirdo". I can run the same code locally and it works fine, I can even load the site from Weirdo onto another remote machine or my local machine and it works. It's only on Weirdo and only in rows of a particular table do inline event handlers fail. There happens to be some level 1 handlers in the same row and they work fine, I can even dynamically assign a handler using the url bar and it will work. On the same page, but not in the table, I can click another icon that has an inline onClick and it works fine. This is the exact same code being run on every machine and only on Weirdo does it not work.

I've tried many different things, I've simplified the onClick to just a basic alert('hi') and I get nothing. I tried onMouseDown plus various others. I went ahead and assigned an onClick to the BODY element to track all the clicks on the page. They show up for the TR I'm talking about but they still don't run, I went into a debugger and event.element() returns for the icon I'm clicking and event.element().onclick shows alert('hi'). If I try event.element().onclick() I get an error "Object doesn't support this property or method."

The only difference I noticed between Weirdo and a different machine where it works is if I do element.onclick on Weirdo in the debugger, like I said above, I get the actual text alert('hi') but on a working machine it returns an actual function object. If I use the browser URL bar on Weirdo:
javascript:alert($$('IMG.DrillDownPlus')[0].getAttribute('onclick')) will alert the text alert('hi');
but on a working machine, it alerts:
function anonymous()
{
alert('hi')
}
Maybe someone can point me to a web site that says exhaustively in verbose detail how the browser handles inline events (I couldn't find anything sufficient).


Any ideas at all? I've tried just about everything. Note Weirdo is running ie7 and the other machines have used ie6 or 7 to load the site, currently just these browsers need to be supported.


At the last minute before posting, I decided to ask a colleague if he had found anything new. He had actually not been working on it but was convinced that it had to be something to do with security settings in IE. Now, the remote system where we were experiencing this issue is a Windows 2003 server so by default it has higher security settings than usual. Still though that doesn't explain the issue, if security settings are the problem, why do inline event handlers work elsewhere on the page and just not in one spot? It would make more sense if they refused to work everywhere but they didn't. Anyways my colleague compared browser trusted sites on another system and decided to add about:blank to the list of trusted sites. Wouldn't you know this fixed the problem! It still makes absolutely no sense to me. I would like to find detailed information as to how Internet Explorer handles inline events but I have a feeling such information is not available to the general public. Anyways the solution is found and we can finally move on from this pain :P .

Comments