Pew Pew Laser Blog

Code. Glass art. Games. Baking. Cats. From Seattle, Washington and various sundry satellite locations.

Past Blogs

This One Time.


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.


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:

On URIs.


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="" />

Selecting Children in the DOM.


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="" id="theA">Wired</a>
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


My desktop computer recently crashed, so I've had to spend some time getting it back up and running. I've just about got it, 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