Skip to main content

On The Endless Wonders Of Internet Explorer

May be somebody will stumble upon this post and save some time for him/herself.
Apparently—it only become apparent after several hours of trial, cursing and error, as it usually goes with IE—, Internet Explorer (up to version 7) throws a runtime error, if you try to modify innerHTML of the dynamically created element under certain conditions.
The conditions, as it always go with IE, are significantly lacking consistent logic. For starters, if you assign innerHTML to the element before you insert it into a DOM tree, the error may not come up at all, but will surface later, when you try to modify it.
So far it looks like the error mostly comes up, if you change innerHTML of the block element inserted into inline element (which is not kosher in standard-compliant HTML, so it makes sense), and some nested block elements (like DIVs inside Ps—why is that considered wrong, too?—for instance).
So, if one really-really need to insert a division into a paragraph, and work it's innerHTML (like I did), one has to use span instead and set it's display property to block—that seems to trick IE into errorless mode.

I've put up a test page to illustrate all of the above.

Needless to say, Firefox and Safari handle all variations correctly no matter what.

P.S. I am mostly pissed because my Palm T|X had a severe crash this morning, and is currently stuck with a white screen of death (even the reset button doesn't work, damn it). Now I have to wait for the battery to drain and hope that it will reset itself after that.

P.P.S It did. Yay.

Popular posts from this blog

Who is running MacAddict forums?

I normally hate to complain, but, being a happy subscriber to the magazine for some time now, feel like I do need to express a concern about my recent experience with MacAddict forums section of the web site. Due to some server misbehavior, I had to re-register, my old profile disappeared, while I was updating it. My new profile was assign a label "n00b" (None Of Our Business, if I am not mistaken. This is some way to welcome a new member to the MacAddict community). It could've been cute, but it isn't. And I don't think, it was intended to be: from the post of "Scott": "...using tables for layout...is for lame-ass n00bs..." I have read several more posts in the "Web Design and Development" forum, which, for some reason, was for a couple of days named "George" (the name is back to normal now; but here is how forum moderator "Gipetto" reacted when he was asked about this oddity: "...poop, it blew me away tha...

{position:fixed} in iOS 6

I stumbled upon this oddity when upgrading to iOS 6 while working on a mobile advertising project, and it took me a better part of the day to figure out what is going on: all of a sudden an element {position:fixed} stopped working in a correct manner (which is staying put, while the page is scrolling), and started "sticking" to the scrolling page, moving out of the viewport, and then just "jumping" back to the correct location after the scrolling was finished.If you scroll this page , you will see it—hint: that's the one labeled "broken"—assuming that you have a correct device/browser combination. Mine was iPhone4 and iOS 6.0 (6.0.1-6.1.3 behaves just the same). On the original page, where I first encountered the problem, all of my elements were created dynamically using JavaScript, but at the end of the day (literally) it become clear, that the glitch is in the iOS 6 CSS implementation.Here is what happens: if you have an element {position:fixed} whic...

May 1st Reboot 2016

My main site gets a facelift (about half-a-decade overdue). Due to a chronic caching issues with iPage, I have to model everything on CodePen , and then FTP files to iPage, where, for some mysterious reason, html gets updated instantly, but CSS and Javascripts marinate somewhere for at least half an hour, before starting to render, which makes it impossible to model anything in real time. Annoying. Oh, well. At least I finally got to re-doing the site. I still do not have a concept for the galleries, though, and a main navigation menu is really primitive, but the new site is HTML5, CSS3 and what not, and I am not ashamed to refer people to it anymore. Yay. P.S. Resolved the cache issue with .htaccess file: FileETag None Header unset ETag Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" Header set Pragma "no-cache" Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"  everything now works a lot livelier. P.P.S. Why is Blo...