I played around with DOM and CSS some more, trying to get the calendar from yesterday to embed well. I had discovered that the CSS that I was using to format the calendar could be easily overridden by CSS that applies to containing elements, causing the calendar to look bad in those circumstances. For example, I had rules with selectors such as "table.calendar td". Unfortunately, when I tried to embed the calendar in a containing document that used selectors such as "div.container td", the latter's rules would override the former's whenever the calendar nested within the container's selected elements. In CSS 2, one can write much more picky selectors, such as "table.calendar > tbody > td" which are very specific. Alas, CSS 2 is neither widespread, nor well implemented. So, I rewrote the calendar HTML and CSS so that every calendar element that needed styling would have an unambiguous ID or class. As an example of an embedding document, see 2004-08.html.
... until the collector arrives ...
I tried to create an HTML page that used ECMAScript to generate a calendar. First, I used document.write() to create it -- that worked in IE, Mozilla, and Firebird. Then, I tried to use DOM methods. This is much nastier. First, I discovered that IE will not display a table that is created using raw createElement() calls for TR, TD, and TH elements. The debugger reveals that the correct object model has been created, but IE just refuses to display it. I then switched to use the insertRow() and insertCell() methods on the various table objects. This mostly worked in the browsers, but:
- Moz/FB put all rows into the THEAD instead of just the header rows.
- None of the browsers created TH elements in the THEAD section -- they all used TDs.
- IE insisted upon wrapping the text contained in the header at the first space -- whether it needed to wrap or not.
After much fidgeting, I just could not get the bugs to disappear. I guess that it is best to use good old document.write()... but that means that one needs to do HTML escaping.
Update: I found a workable compromise. First, I didn't bother with the THEAD element at all since Moz got it wrong. Second, I used createElement("th") to create the header cells. IE doesn't seem to choke on that. The result is in calendar.html.
We had lots of inexplicable performance problems with the network today, starting right in the morning. The problems appeared to be confined to the switch in the tech office. We tried swapping switches and cables, with no effect. I rebooted the main switch in the computer closet. That appeared to fix the problems.
I also noticed some zero page, zero byte print jobs were being reported for my user id whenever I tried to browse a network drive. It turns out that TortoiseSVN scans all shares for .SVN files -- including printers! Apparently, this causes these bogus print jobs to appear.
- ► 2012 (27)
- ► 2011 (8)
- ► 2010 (25)
- ► 2009 (51)
- ► 2008 (78)
- ► 2007 (94)
- ► 2006 (135)
- ► 2005 (58)
- ▼ 2004 (68)
- ► 1999 (10)