Skip to main content

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()
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 .


Popular posts from this blog

Fancy FTP Deployment with Grunt

I recently dove into Grunt.js at work for automating our build process and I haven’t looked back. It’s an awesome tool with a plug-in for just about anything. I expected the usual would be there like JavaScript minification and concatenation, but I was surprised at a few others that I found, one being for FTP file deployment. Just shows how popular and community supported Grunt is.

There are a few FTP plug-ins available for Grunt. I didn’t do an analysis of all of them but ran across grunt-ftp-push which seemed to do what I needed so I decided to try it out. A simple ftp-push setup to upload an entire project via FTP could look like this:

Some details here: I opted to put the username and password in the main config rather than using an .ftpauth file. The …

Accessing other HTTP servers on Cloud 9 IDE

If you're using Cloud 9 to do development, you'll quickly realize that only ports 8080 through 8082 are available to the outside world from your development box. This is generally not an issue as you can set your application to bind to the $PORT environment variable when in development mode. However, there are sometimes other servers that we want to make use of that host on different default ports.

I recently had to setup a Neo4j server which defaults the admin interface of port 7474. Unfortunately, I could not access the admin interface even through the IDE based web browser window. So, what to do? I could change the default server settings so that it runs on a different port. However, the app I'm working on with a team has 7474 hard-coded and I currently don't feel like writing a local only work-around.

After some searching, I ran across a neat Linux tool called socat. This allows us to easily forward one port to another. After a quick install via apt-get, I ran the …

Moving to Babel 6 on the Server

Cross post from my employer's development blog:

Decided it was time to upgrade my server-side code to run on Babel 6. Below is a synopsis of all the issues I ran into and resolved while upgrading my 0.11.3 SailsJS server to run with Babel 6 transpilation.

The upgrade to Babel 6 itself is easily achieved in Sails by upgrading the `sails-hook-babel` package.

### Missing preset
`couldn't find preset "stage-0" relative to directory`
Just because a preset is on the official Babel preset page, doesn’t mean that Babel comes with it. Simple fix by installing the [package][1] from npm. Read more [here][2].

### Need strict mode everywhere
`Block-scoped declarations (let, const, function, class) not yet supported outside strict mode`
I didn’t have to worry about this before, and I don’t feel like …