Gotcha: Removing Iframe Border in IE.

Think I’m gonna start a little mini-series of blog posts with the little “gotchas” I run into during the course of an ordinary day at work. Some of the pitfalls I’ve run into lately have been ridiculous. Bloody IE!

Todays one is a fun one. Removing a frameborder on an iframe in Internet Explorer is case-sensitive, would you believe it!

That is to say:

1
<iframe frameborder="0" src="http://www.google.com.au/"></iframe>

.. Probably won’t work. Whereas:

1
<iframe frameBorder="0" src="http://www.google.com.au/"></iframe>

Will!

This also extends to creating an iframe using DOM. You need to do this: Think I’m gonna start a little mini-series of blog posts with the little “gotchas” I run into during the course of an ordinary day at work. Some of the pitfalls I’ve run into lately have been ridiculous. Bloody IE!

Todays one is a fun one. Removing a frameborder on an iframe in Internet Explorer is case-sensitive, would you believe it!

That is to say:

1
myIframeEl.setAttribute("frameborder", "0");

Is not going to work in IE.

1
myIframeEl.setAttribute("frameBorder", "0");

But this will.

Comments