April 2002

04/26/2002 Friday

An image's alt attribute is intended as alternate text that appears if the image doesn't load (or during page load before the image has loaded). We are also accustomed to seeing alt text in a tool-tip popup when you hover over an image (except in Mozilla). If a title attribute is provided as well, the title becomes the tooltip content (except in NS4.x which doesn't support title). For <input type="image">, NS4.x ignores alt but will show the value of the name attribute in the tooltip.
17:25 permalink

04/25/2002 Thursday

Macromedia: Internet Explorer 5.1.4 upgrade installs Macromedia Flash Player 5. So if you have Flash 6 installed, you'll have to reinstall it after installing IE5.1.4.
09:00 permalink

04/22/2002 Monday

<input type="button"> vs a linked <img>

IE5.5 PC yes yes yes yes yes yes
NS4.x PC no no no yes no yes
Moz Mac yes yes yes yes yes yes

"Tabbed focus" means the element receives focus when you hit the tab key. "Onmouseover events" means the element supports the onmouseover event handler (which allows rollovers).
18:00 permalink

You know what's sad? People who dream of becoming what they can never be because they just don't have it. Like the kid in grade school who wanted to be a goalie for Montreal. It was the one thing that he wanted to be and he tried so hard. But you knew it was never going to happen. And like the guy in university who studied every weekend, all weekend because he wanted to get into med school even though he was barely passing his genetics and biochem courses. And like the junior designer who bookmarks all the right people, visits all the right sites, reads all the right magazines, re-designs their site every 2 months but will never be good enough to get that art director position that is at the heart of everything to them. So sad.
16:30 permalink

In IE and Mozilla, you can check the value of the currently selected option in a dropdown list using selectReference.value (where selectReference is the reference to the select box element) but NS4.7 still requires you to go through the selectReference[selectReference.selectedIndex].value.
15:50 permalink

I get lots of spam and viruses (probably because there's lots of scripts out there with my unencrypted email address in them - stupid me). As a result, I delete a lot of email without even looking at it. If I don't recognize the name of the sender, I'll ditch anything with an attachment. Recently, I've been getting email with HTML and Javascript phrases as titles so I'll also delete anything with a title like "bgcolor" or "with(document)". So, when emailing me, use a descriptive title and avoid attachments (put sample code inline or email me before you send an attachment to let me know). Oh, and I trust text-only email much more than HTML email.
09:30 permalink

04/19/2002 Friday

I read somewhere that IE considers http-equiv and name interchangable in <meta> tags. At least for MS-specific ones. However, Allan reports that

<meta name="imagetoolbar" content="no" />

doesn't work while

<meta http-equiv="imagetoolbar" content="no" />

does (this turns off IE's image toolbar that appears when you hover over an image). When in doubt, check Google. A search for name="imagetoolbar" returns 1 result while http-equiv="imagetoolbar" returns 334.
08:40 permalink

04/18/2002 Thursday

From Webdesign-L: Applying a border CSS rule to an a selector causes NS4.x to convert anchors from inline elements to block elements. And with this conversion, the a element appears to lose all it's event handlers (ie, clicking the link doesn't do anything).
19:10 permalink

Idea: Someone should patent the method the patent office goes through to award patents and then sue the patent office for infringement of patent.
12:10 permalink

In trying to position a bigger-than-the-browser-window image in NS4.x, Cory found that it would be positioned 6px down and to the right from where it should have been. For that particular image, the positioning coordinate system was off (so trying to fix the problem by using Javascript to set the correct top and left values doesn't work). Our quick-and-dirty fix was to adjust the position 6px up and to the left for NS4.x which put it in the right spot in all browsers.
11:25 permalink

04/16/2002 Tuesday

IE5 Mac doesn't provide a Array.push() method though it is present in the PC version. You can define your own version (see the recently-recoded Array Extensions script) if you need it.
16:40 permalink

Here's my version of Scott Andrew's isUndefined() function:

function isUndefined(property) {
   return (typeof property == 'undefined');

As far as I know, the undefined operator is the only one that differentiates between undefined and null (typeof null should return 'object'). I also define an isDefined() function because !isUndefined(property) doesn't scan well. Update: Dave Linquist reminded me that the identity operator (===) can also distinguish between undefined and null.
13:50 permalink

Few browsers support the window.onscroll event handler. IE4+ PC is the only one that does it reliably. For every other browser, you need to do a setInterval() to compare the current scroll position of the window with a past scroll position (remembered in the previous interval). In IE Mac, you check document.body.scrollTop and document.body.scrollLeft. In NS4+ (including Mozilla), you check window.pageXOffset and window.pageYOffset. The Mozilla documentation mentions window.onscroll but one of the big outstanding Mozilla DOM bugs is the fact that both window.onscroll and element.onscroll don't fire. Mozilla also supports document.body.scrollTop and document.body.scrollLeft but both always have the value 0 - probably because of the window.onscroll bug. Trying to set the values of these properties manually doesn't cause the window to scroll and the new values aren't reflected in the properties afterwards. Update: Andy Edmonds writes to say he's gotten scrollTop and scrollLeft to work read-only in Mozilla 0.9.8+. This wouldn't be the first time my machine decides to work differently from anyone elses. Also, scrollTop and scrollLeft aren't available in NS6.0 through NS6.2.2.
13:40 permalink

If you want a popup window to perform an action (submit a form or load a document in another window) and immediately close, set a timeout on the window closing action or the window may not have enough time to perform the first action in IE Mac.
13:30 permalink

04/15/2002 Monday

In the days before the web, if you knew the secret and suppressed TRUTH and you knew that it was up to you alone to broadcast the TRUTH to an unsuspecting and dupped world, you needed real commitment. You had to spend lots of time and money just to get the TRUTH out there. You would go hungry so that you could Xerox (it wasn't called "photocopying" back then) hundreds of pamphlets and leaflets. You'd spend whatever time you could standing on street corners handing them out, posting them on university notice boards, sticking them under car windshield wipers. And if the truth was really big, you would write a book and self-publish it at a vanity press. The quality of TRUTH you could get back then from these committed souls was really good. Now, anyone can rent a computer at Kinkos and bang out a Geocities site in an afternoon. Yes, there is so much more out there for us kookologists but the quality of material has declined.
09:50 permalink

We (the company that I work for) have supported legacy browsers longer than most, I think. Soon, however, we will (might) be dropping support for IE4.5 Mac on most of our projects. Supporting IE4.5 Mac makes writing DHTML difficult. But it makes authoring in Flash maddening. Links in a Flash movie in this browser are relative to the movie and not the HTML page so you have to put both files in the same directory. And doing a popup from Flash requires the more-complex-than-neccessary getURL-into-a-hidden-frame hack. For a browser with less than 0.3% market share, jumping through all these hoops doesn't make sense. Goodbye, IE4.5 Mac.
09:30 permalink

A list of Mozilla's quirks mode behaviours. In particular, check out the quirks mode style sheet. (via a Doctype discussion at ALA via Milov)
09:00 permalink

04/05/2002 Friday

Solution to the uneditable src attribute of the <script> tag: write out the <script> tag using the innerHTML property of a DOM-created div element.
11:15 permalink

04/02/2002 Tuesday

In Mozilla, formatting whitespace in the document source is represented in the document tree created by the DOM. You have to be careful in working through the tree to avoid all the formatting whitespace. IE generally ignores formatting whitespace when building the document tree but the occasional extra node is thrown in. IE6 seems to also create an extra node after img nodes (at least when the tree is build automatically by the browser from HTML source). Even if you remove all whitespace after the <img> tag, the extra node still occurs. Before blindly working with any node, check that it's what you expect it to be.
10:00 permalink

IE5 Mac doesn't let you set the scr attribute of a script element.
09:40 permalink

04/01/2002 Monday

Back in June, Mozilla measured the offset properties (offsetTop and offsetLeft) from the document origin. By the time Mozilla 0.9.4 was released, Mozilla was following the IE practice of measuring the offset properties from an element's parent (so to find the offset from the window, one would have to work up through the containment hierarchy adding up all the offsets). All the NS6.x releases at the time followed the old behaviour from the early Mozilla releases. I predicted that later NS6.x releases would follow Mozilla's lead. Doesn't look like it - though NS6.2 is based on Mozilla 0.9.4 code, it still measures offsets the old way.
12:45 permalink

Mozilla User-Agent Strings. Note the Netscape re-branded release example (second from the bottom) isn't exactly how Netscape6.x's user-agent string appears - the Vendor Product Token is in the form Netscape6/6.x where the x is the sub-version number.
12:25 permalink

Last week, I re-wrote the Browser Detect Lite script. Instead of creating a new object to hold all the properties created by the script, I decided to use the navigator object. Logically, that's where those properties would belong. Unfortunately, Mozilla doesn't like expando properties in the navigator object (or any other top-level object like history, location, Math, or screen). The properties hang around for a couple seconds after load and then get removed and become undefined. Properties can be created safely in window (this is how top-level variables and functions are created) and document. I can't find any documentation that says why expando properties aren't allowed on all browser-created objects, whether this is a bug, or how to fix it. Oddly enough, NS6.x seems to be ok. So, I've changed back to a custom object to hold all the Browser Detect Lite properties until I work this out.
12:00 permalink