May 2002

05/30/2002 Thursday

Youngpup finds a possible name-collision issue with function arguments and function properties in Mozilla (look for the 05.30.02 entry). Function arguments will over-ride similarly named properties and are available outside the scope of the function call.
09:00 permalink

When dynamically building tables with the DOM and using setAttribute() to assign a cellspacing, the attribute name must be in mixed case (cellSpacing) for it to work in IE.
08:50 permalink

05/29/2002 Wednesday

In order to get the contents of a textarea to wrap in Mozilla, you need to specify both rows and cols (as per the XHTML DTD) even if you set the dimensions of the element with CSS properties.
09:10 permalink

05/27/2002 Monday

The Vancouver International Children's Festival is celebrating it's 25 anniversary. As a former child, I don't understand the attraction. First of all, look at that clown. Any kid under 7 would be terrified of it; older kids would be bored / embarrassed by it. I don't understand why a bunch of slightly-neurotic, under-employed spinsters who's only contact with children is some distant neices and nephews and a gladly forgotten, awkward childhood think they know what kids like. I don't have kids but I can tell you they don't like marionettes, stilt walkers, songs about imaginary friends, any instruments other than drums (loud ones), granola snacks, poems, plays of any length, jugglers, sitting still, or crafts. In order from babies to preteens, kids like: bodily functions, making noise, crackers that can be rendered into a mushy paste, dirt, Teletubbies, Sesame Street, cartoons, any tv at all regardless of content, hurting each other (verbally, mentally and physically), candy, bland food, pets, anything owned by any other kid, physical possessions, consumerism, crappy music, video games, anything that will annoy / anger / worry their parents.
10:10 permalink

Guimp.com: world's smallest website. (via Milov)
09:10 permalink

05/24/2002 Friday

Some noteworthy updates: I build a set of Javascript-based compression utilities from my recent 5k entry and used it to recompress some of the 1k DHTML API scripts.
17:20 permalink

05/23/2002 Thursday

Another contest: The 2002 Invitational TableArt Contest. Make pictures with tables. In this context, "invitational" seems to mean "you are invited already". (via Glish)
09:15 permalink

05/22/2002 Wednesday

The 2002 anything-goes 5K Contest is on and I have a couple projects lined up. The first is a compression utility that will take 5k entries and compress them. All Javascript. I am borrowing the compression scheme used by Brent and Liorean in their 1k DHTML API variants with some minimization enhancements and the ability to compress whole HTML files. Works great. Squeezed my old Space Invaders code from 5120 bytes to about 3200. Unfortunately, the keyboard events don't work on the compressed version. I figure it's because I am using document.write() to write the code to the document after decompression and that browsers parse this code differently than if it were parsed as part of a static HTML file. Anyone know why or have any solutions? Update: I managed to compress a page that used keyboard events and it still worked so it must be something specific to the Space Invaders code.
17:30 permalink

The 2002 anything-goes 5K Contest is on and I have a couple projects lined up. The first is a compression utility that will take 5k entries and compress them. All Javascript. I am borrowing the compression scheme used by Brent and Liorean in their 1k DHTML API variants with some minimization enhancements and the ability to compress whole HTML files. Works great. Squeezed my old Space Invaders code from 5120 bytes to about 3200. Unfortunately, the keyboard events don't work on the compressed version. I figure it's because I am using document.write() to write the code to the document after decompression and that browsers parse this code differently than if it were parsed as part of a static HTML file. Anyone know why or have any solutions?
17:20 permalink

05/21/2002 Tuesday

When building a CSS layout, I usually rely on the implicit z-index order that comes with code order. That is, positioned elements that appear later in the code order will appear above elements that were earlier in the code. I know that all elements without an explicit z-index property specified all have the same z-index but they layer as if it were specified. This works fine except when you have text links in IE5 Mac. If you have a positioned image followed by a positioned text link that occupy the same location, the text will appear above the image (as it should, following the implicit z-index given by the code order), but the text won't be linked - your cursor won't change when hovering over the text and you can't click on the text to follow the link. To get the link to work, you need to explicitly specify a higher z-index on the text link. Linked images work as expected.
09:05 permalink

05/17/2002 Friday

Webdesign-L: When creating new objects, create them in the context of the window that should own the object. If you create a new select list option (new Option()) in one window and add the option to a select list in a second window, closing the first window will cause the option object to be garbage collected in IE Mac and the application will crash because the reference to the option object in the second window is left hanging.
08:30 permalink

05/16/2002 Thursday

Hi. I'm not sending you virii. Honestly. Here's what's happening: there is a virus and it is infecting other people's computers. Then it scours files on that computer looking for email addresses. It then sends itself out to that email address with a random snip of the same document as the email subject. Which is why I am getting so many infected emails that have bits of HTML and JS code as subject titles - 'cause the virus is grabbing my email address from HTML pages in other people's browser cache. This virus also sends itself to other people and spoofing my address in the From header. Which is why it looks like the virus is coming from me. But it's not. Really.
12:00 permalink

Macromedia: Flash Player Version Penetration. Install stats broken down by geographical region and player version. Most recent information is from March but it looks like it's updated often. (via Webdesign-L)
09:25 permalink

Apparently, NS4.x will request an image specified in a background-image CSS property everytime it is used instead of requesting once and grabbing it from the cache on subsequent usages. (via Webdesign-L)
09:20 permalink

Brilliant! Derek Robinson provides a way around the size limitations of bookmarklets - use the DOM to create a script element that loads an external script. Milov's linedraw bookmarklet has another approach which isn't applicable for every application but is neat - create a transparent iframe over the whole document and the actual functionality of the bookmarklet is in the document loaded by the iframe.
09:15 permalink

05/14/2002 Tuesday

Yesterday's innerHTML replacement isn't really DOM-compliant as Scott Andrew points out.
09:40 permalink

05/13/2002 Monday

I have come up with a new ad campaign for Translink, Vancouver's transit company / board / whatever it is.

Ad 1: Interior of a bus waiting at Lonsdale Quay as seen from near the back. Only 4 people visible. No-one is talking. After 25 seconds, the slogan appears on the screen: "You may not go anywhere, but at least it's quiet."

Ad 2: Interior of a bus from UBC to downtown on Friday night. Bus is full of noisy kids yelling drunkenly at each other. Some guy is retching out the window. Slogan: "It might not be quiet, but at least you'll meet some interesting people."

Ad 3: Interior of a bus during morning rush-hour. Lots of people in business suits staring straight ahead and not talking. Slogan: "You may not meet interesting people, but at least you are out of the rain."

Ad 4: Interior of a bus. Someone is struggling to close a window that is jammed open. Rain and window pour in through the window. Slogan: "You may get wet, but at least it's efficient."

Ad 5: Huge crowd leaving a Skytrain station and lining up for a bus that can't fit everyone on. Throughout, there is an announcement over the station speakers to the effect that a computer fault has halted all trains and that you need to take a bus. Slogan: "It may not be efficient, but at least we show up."

Ad 6: Waiting at a bus stop on the Barnet Highway. View of mountains but no buses. Slogan: "We may not show up, but at least it's scenic."

Ad 7: View from bus waiting for the light at Hastings and Main. Junkies, prostitutes, drunks, crackheads, etc. Bus pulls away at end of ad. Slogan: "It may not be scenic, but at least you are getting somewhere."
11:00 permalink

A DOM-compliant function that takes the place of innerHTML Also, a debate on the validity of using innerHTML (with a list of browsers that support the property). (via Webdesign-L)
09:10 permalink

Bookmarklets are limited to 600 characters in IE6 (down from 2000 in IE5.5). (via Webdesign-L)
09:00 permalink

05/10/2002 Friday

New Architect: Why DHTML Will Win. A response to Flash MX being labelled as a web application platform. I have found that Flash is generally used to disguise the fact that there is no content. Having no content doesn't mean that you don't have a message. Instead, the message is you. Your "brand". Flash is good for branding. If you have no content, consider Flash. If you have content, accessibility to that content is important and a different technology (ie, DHTML) might be the answer. Not to say Flash can't be made to be accessible. But if it is, it starts looking like DHTML anyways. (via Tremendo)
09:00 permalink

05/09/2002 Thursday

Don't think I've mentioned this before: NS4.x doesn't run external .js files in a newly opened window. This affects the initial load of the first document in the new window. If you reload the page, it'll work fine. To avoid this bug, include a check for one of the global variables defined in one of your .js files and reload the page if it isn't defined:

<script>
setTimeout('if (myExternalVar == null) location.reload()', 200);
</script>
       

The setTimeout() gives the external scripts time to load and parse.
08:50 permalink

Even if you set a width on positioned elements with left values that position them off-screen, NS4.x will ignore the width and try to shrink the element as much as possible horizontally. If the element contains text, you end up with a skinny, tall paragraph that is as wide as the longest word. Even if the element contains an image that should keep the element's width from shrinking, the text will still wrap as if the image isn't there. To fix it, initially position the element on-screen (ie, with a low left value) but invisible and set the left property to the correct value and make it visible as soon as the element loads (you don't have to wait for the page to finish loading).
08:45 permalink

Archives