About » Tidbits

This and That

A vs An

More than one native English speaker have given me fuzzy answers about the use of “a” vs “an”. I guess I should never have asked! I was taught to always use “a” before a word whose pronunciation begins with a consonant and “an” before a word whose pronunciation begins with a vowel. I was confused for some time only because I saw respectable publications violating this rule. But, I should not have worried as this article and this reference point out.

Javascript and IE7

My official web-site had been long overdue for an overhaul, especially in terms of appearance. When I discovered the increasing dislike of frames among web authors I decided it was time to bite the bullet since my web-site used frames extensively. I had carefully avoided using Javascript on the earlier incarnation of my web-site because I wanted the site to be browser-independent and Javascript was known to have several incompatibilities across browsers. This time I decided that by now the standard should have stabilized and sufficient time has passed for all the browsers to catch up. Fortunately, I was right—mostly. Even with the basic Javascript constructs that I used I ran into one incompatibility

No points for guessing which browser is the culprit! Microsoft Internet Explorer (IE7) uses className as the class attribute, as against class that is used by every other browser! The fix is simple. Whenever I use setAttribute to set a class attribute I set both class and className attributes to the same value. Everything else works perfectly. One thing about IE7 is still a mystery to me, which is that it displays a horizontal scroll bar even when all the content is well within the viewport. In effect it renders the page in about 40% wider space than it needs to, but all the extra space to the right of the viewport is simply the background. I have not tried to “explore” this further because it is a relatively minor issue and does not affect the look and feel of the web-site.

I should also mention that for manipulating the DOM hierarchy I found a brief tutorial on Apple web-site most helpful.

I realize that at least one web-site that disapproves of frames also disapproves of Javascript. However, opposition to Javascript is not nearly as universal and there are good reasons to use it, notwithstanding the security issues with it. Moreover, the site can be designed to be perfectly usable even with Javascript turned off. An alternative, of course, is to use server-side scripting, such as PHP. But, I would rather write in Ruby ...

Arun Chauhan / Computer Science / Indiana University