Past Blogs — May 2011

This One Time.

5.30.2011

Once I re-installed Windows 3.1 because one of my program groups was gone. (It wasn't that bad; I installed the new version on top of the old version.)

Bear in mind that there was no Google or internet help forum at that time. I re-installed because it was practically the only thing I knew how to do. I did later find the "Create Program Group" option in the File menu.

Tales of Shame.

5.24.2011

I have heard a few tales of the shame of Internet Explorer 6, the web browser famously despised by web developers (even its own creator). Submitted for your approval, here are a couple of those tales:

  • Six years passed between the release of Internet Explorer 6 (2001) and the next version, IE7 (2007). Why so long? I was told that after IE6 was released, Microsoft decided that browser wars were won. The development team disbanded. I recently mentioned this story to an actual longtime Microsoft employee, who said "that sounds about right".
  • An large technical organization has some critical business applications which only work in IE6. They will be upgrading all their workstations to Windows 7, which includes Internet Explorer 8, but not IE6. The solution? Instead of upgrading the legacy web application, this organization will provide virtual WinXp machines with IE6.

On URIs.

5.18.2011

To call an asset (such as an image, stylesheet or JavaScript) from same directory as the current page, then start the URI with the filename. Example:

<img src="happy-kitty.jpg" />

To call something from the same domain as the current page, then start the URI with / and include the directory structure. Example:

<img src="/images/happy-kitty.jpg" />

To use the same protocol as the existing page, start the URI with //, and include the entire directory structure. <script src="//library/the-script.js"></script> This is useful for when you need to call assets via HTTPS, but only when your page itself has been delivered to the browser via HTTPS.

To pull in an asset from anywhere in the world wide web, just use the fully qualified URI.

<img src="http://somthing.com/best-kitty.jpg" />

Selecting Children in the DOM.

5.8.2011

Sometimes, it's necessary to use JavaScript to walk through the HTML elements on a page. The function childNodes() function (as well as firstChild, lastChild, and previousSibling) seems like a great great way to to this. Unfortunately, it'll produce vastly different results in different browsers.

Firefox evaluates any white space in the element as a text node, so if your HTML is like this: <div id="theDiv"> <a href="http://www.wired.com" id="theA">Wired</a> </div> then firstChild will be the line break. Other browsers will return the anchor element as the firstChild. Blech.

Instead, use getElementsByTagName("*"), which will get only tags. For the above HTML, this JavaScript will get the link value: theAnchor = document.getElementById("theDiv").getElementsByTagName("*")[0]; theHref = theAnchor.getAttribute("href"); Since the first element inside theDiv is the anchor.

Installing CS3 From Hard Disk

5.1.2011

My desktop computer recently crashed, so I've been spending a lot of time lately. I've got almost everything back up and running, but my DVD drive is only working in Safe Mode. This caused me trouble when I tried to re-install Adobe C3 (for Dreamweaver and Photoshop, mostly). In the end, here's what I had to do:

  1. Copy the contents of the first disc to my hard disk, in any folder.
  2. Copy the contents of the payloads directories from each of the other discs into the payloads directory on my hard disk. No files were replaced.
  3. Run the installer (setup.exe) from the Adobe CS3 directory on my hard disk. From this location, setup looks for all of the files on the hard disk, instead of asking for the next CD.

Last Month

Next Month