Pixelbox

Welcome to Pixelbox. Friday the 5 of September 2008

Skip to content >>

IEs support for the DOM sucks

Again I find myself running into problems with IE, today its with it's DOM support.

I recently wrote some JavaScript to look at a links href attribute to detect if the link was external or not (the existence of HTTP:// would show it was external). The problem was that Internet Explorer showed the absolute href rather than the text content of the attribute in the DOM. Therefore it meant that every link had HTTP:// in it's href attribute.

I discovered that you could pass a section option in the JavaScript for .getAttribute that would force IE to return the value of the href in the DOM rather than how it saw it. This was found via Glenn Jone's post on Internet Explorers getAttribute href bug.

Another day another IE work around... sigh

2 comments

Why not leave your own!

  1. Just design specifically for IE. Most internet users have it, and if it doesn't work for them then your site is rubbish. Don't fight it. Don't hate it. It's just IE, and what the world looks at the internet through.
  2. Coding using web standards is the only way to code mate. Look at the changed form IE6 to 7 and the way things are going they are going to need to make more soon. Standards are the only way you know your code is not redundant!

Add your own comment