scottandrew.com

Noteworthy

You're currently viewing a very old version of this website. Follow me to the latest version.

-->

November 29, 2001

The Mozilla DOM Inspector

I saw this cool DOM Inspector app demoed at the Mozilla Developer Day conference. [screenshot] It's now available in the nightly builds. Written in XUL/XBL and JavaScript, it's a nice demonstration of Mozilla's abilities as an application and UI framework.

November 28, 2001

Foreign scripts with bookmarklets

This cool bookmarklet from Josh Santangelo exposes all of the <!-- comments --> in the web page you happen to be looking at, and introduces an intriguing thing: the bookmarklet imports a JavaScript file from another domain and attaches it to the page, via the DOM interface. Look at this code snippet (from the bookmarklet):

scScript=document.createElement('script');
scScript.src='http://dbz.nu/x/showcomments.js';
scScript.type='text/javascript';
scScript.defer=true;
void(document.getElementsByTagName('head')[0].appendChild(scScript));


The script then runs in the context of the page being viewed, even though it's a foreign script from another domain. Hmmm. (linkage via Matt)

November 25, 2001

Pumpkin butter and bass licks

I was a little nervous we might have overdone it with the wine, having in the end brought five bottles to add to the five brought by various other guests. This turned out to be a good thing, though, as I'm pretty sure all ten were empty by the end of the evening. Sautéed green beans and shallots? Mashed yams? Pumpkin butter? I will tell you right now I do not, will not ever, deserve to have pumpkin butter.

Sitting upright in its stand next to my computer desk is a cheap, cheap, very cheap bass guitar I bought this past summer, a Squire P-Bass, which is a hybrid of the famous Fender Precision and Jazz models. It has a candy-shell blue, blue as a blue M&M, with a mahogany fretboard and still has the original strings. I keep it by the desk for those slow moments when the computer is booting up, or surfing in between pages on my ancient dialup connection. I don't play anything in particular and I'm not very good, but I'm getting there. I finally figured out why it's better to pop the strings with the index finger rather than the middle one (better hand position, better control), and how to cleanly thumb-slap the higher strings without too much incidental noise from the neighboring ones. My goal is to get that that muted, percussive slap-pop technique down cold. Think of Peter Gabriel's Big Time, where Tony Levin's grunting-pig bassline kicks in: bumpita-bup, buh dutta-dutta dah, buppa. I figure if I finally break down and get a cable modem or DSL connection, my finger technique will suffer, so I make do.

November 21, 2001

Tips for a Happy Thanksgiving

Remember:

1. Don't eat the beak
2. Don't eat the feet
3. Those brave enough to eat the heart of the turkey gain the strength and power of the turkey.

Mozilla 0.9.6 released

Mozilla 0.9.6 is released. Not a heck of a lot of new stuff to write home about. Support for ICO and BMP images. LINK tags can be used to display icons in the URL bar now, similar to IE's miserable favicon.ico (support for which, BTW, is scheduled for Mozilla 0.9.7. Oh, great). And a search feature which allows you to search for mouse-highlighted text in your favorite search engine. Some mail and printing bugs have been squashed as well.

November 20, 2001

A Fright At The Opera (5.x)

Georgi Guninski has discovered that versions of the Opera 5.x on both Windows and Linux allow scripts to be executed across domains, bypassing browser security settings. Oops.

Mozilla Day Wrapup

So, there's a reason why I haven't posted about the Mozilla Developer Day event I attended nearly two weeks ago: it just didn't leave an impression on me. Kudos to the Mozilla team for the effort, and I appreciated the opportunity, but it just didn't seem to gel. Three things come to mind:

- XUL is cool. You can build all kind of widgety web apps with JavaScript glue. Unfortunately, it's not very clear what Netscape wants to do with it. Do they want developers to flock to it? Do they want it to supplant HTA or VB desktop apps? Or is it just a cool toy? It doesn't look like AOL/Netscape have any plans to do anything significant with it. Maybe they need a XUL Evangelist? (random thought: it just occured to me that XUL might be useful for building interfaces for iPlanet portal products. Maybe.)

- It was fun watching Brendan Eich, the creator of JavaScript, give his little status report on the Mozilla project as it approaches a 1.0 release. I seem to remember him mentioning that feature creep was hampering the project and that nice-to-have stuff like native SVG support should be tossed in favor of fixing existing bugs. He talked a bit about memory issues and performance. Brendan has a unique, rather pleasant personality trait in which he can talk to a total stranger as if he'd worked alongside that person for years.

- Cool demos: Classworks, an educational management tool written as a XUL application; SmartClient, a JavaScript application environment; also, a demo of the TIBET development environment (featured once before on this site) which introduces things like object dependency, collection classes, and Smalltalk-like features into JavaScript.

In the end, I left with the impression that web apps are still cool, people are still interested in doing crazy things in the browser, JavaScript will continue to play an important part in the development of web apps and services, that there will eventually be a Mozilla 1.0 release. But I didn't really learn much that I could take away and use in day-to-day development. Still, it was nice.

Postscript: I didn't link to the recent release of Netscape 4.79 on this site. Jeffrey Zeldman already did a good job of covering why Netscape (iPlanet, actually) continues to release (or in his words, "poop out") new versions of this junker.

November 19, 2001

A Defense of Opera 6

A short defense of Opera 6 (read the comments).

Coming down for miles

This weekend the hummingbird returned, with his significant other in tow. I have decided to name him Screechy (short for "Mister McScreechykins") in reference to his unique brand of singing, which sounds not unlike a giant metal cricket and shards of glass being squished through a meat grinder with digital distortion.

On Saturday we drove up to Sebastopol to watch the sky fall from Paul's backyard. I stopped counting at 70, despite the ample fog. Then, on the way back to the city, the fog cleared out just north of San Rafael. We pulled over to watch from the entrance of a state park. I've never seen so many shooting stars. Some flared so brightly they lit the ground beneath (what causes that? Size? Magnesium?). We easily saw 50-60 meteors in the twenty minutes we spent at the park. I should mention that the skies of Northern California at night are not black, but deep cobalt blue. Especially away from city lights. I could actually see all of the Pleiades (including the papoose) and some stars behind Orion I didn't even know were there.

SPAN tags revisited

Did you know that if you give SPAN elements positioning with CSS, NS4.x treats them like layers? If you do something like this:

This is a <span id="mySpan" style="position:relative">test</span>

<script type="text/javascript">
alert("layers: " + document.layers.length);
</script>

...the resulting alert message should read:

layers: 1

Something new (but not necessarily useful) every day.

November 16, 2001

Why Carlisle, Where Are You?

Hey, does anyone out there know Why Carlisle, a.k.a whytheluckystiff, creator of the DX0 DHTML/PHP library? If so, please have his people phone my people. Thanks.

November 15, 2001

IE Cookie Bug Patch

Go here to get the fix for yet another wonderful Internet Explorer security hole, this one allowing strangers to read your cookie file, which may or may not contain stuff like, oh, your passwords and email address.

On whitespace in the DOM

While working on a code sample for the book, I ran into a snag regarding whitespace in HTML documents. While browsers generally ignore (that is, do not display) extra white space between elements, they nonethless still exist in the DOM. For example:

<ul>
  <li id="liOne">First Item</li>
  <li id="liTwo">Second Item</li>
</ul>

Now, consider this related bit of JavaScript... var li = document.getElementById("liOne");
alert(li.nextSibling.nodeValue);

Ideally, the alert should display "LI" because the immediate sibling of the liOne list item appears to be the second one liTwo. But it's not. The alert displays "#text" instead. Why? Because the browser interprets the indentations before the LI elements as whitespace text nodes. And you might be suprised to learn that this is correct behavior for XML parsers (Tim Bray: "if it ain't markup, it's data.").

At first I thought I could solve this with the white-space CSS attribute. white-space directs the browser to either preserve or collapse whitespace characters depending on the value specified. white-space:pre preserves whitespace, white-space:normal collapses it.

But it didn't work as expected. The text nodes were still there in the DOM. It occurred to me that since CSS is largely presentational, the setting white-space might only affect the display of whitespace characters but leave the actual DOM intact. I could be misinterpreting how the white-space property is supposed to work. So, back to the problem. I needed a way to select the next sibling element of any given element via JavaScript, skipping over text and whitespace nodes. After a few brief discussions on several lists, I came up with the following function:

function getNextElement(elm)
{
  var sib = elm.nextSibling;
  while (sib && sib.nodeType != 1)
  {
    sib = sib.nextSibling;
  }
  return sib;
}

(See here for and explanation of nodeValue and nodeType.)

It works. But I really wish I didn't have to create a function to get the adjacent element. It would be very cool if there were a DOCTYPE or something that allowed inter-element whitespace to be dropped from the DOM without a lot of JavaScript fuss.

UPDATE: mere seconds after posting this, Chris Nott sent me a link to this Mozilla technote which outlines several JavaScript functions for dealing with whitespace. Sigh.

Folder Tree Viewer Widgets

From Erik Arvidsson and Emil Eklund comes a nice DHTML folder tree widget. Like many of the WebFX demos at SiteExperts, this widget only works in IE4 and up. (note: this widget was submitted in 1998.)

More explorer-tree-like DHTML widgets: Ivan Peter's ridiculously cool Joust menu (it even works in Netscape 2, geez); Pascal's TreeNode widget for DynAPI2.

HierMenus 4.1.3

A new version of HierMenus is released. Looks like another maintenance release for IE6. One of the things I like about Peter B. is how he documents the problem and the solution in detail with each revision of the popular HierMenus script.

November 14, 2001

The End

The bad thing about sick days is that you can't get anything done, 'cause you're sick.

I finished the book last night. The project isn't over yet; I still have a bunch of screenshots due and we haven't even gotten to author review yet. But the huge task of writing (and the accompanying psychological burden) is over and done with. Which is good, because frankly, I'm close to burned out. I hate feeling burned out, because then I feel like I'm not pulling my weight as much as I should. I should be thinking about pitching more article ideas, finishing projects at work, writing more tutorials for this site, and posting more DHTML and JavaScript links of note. Instead, I'm thinking about video games, camping along the coast, my new (and yet unused) pair of running shoes, guitar strings, diamond schlager blades. Maybe I just need a nap. Yeah, that sounds good.

November 13, 2001

Bloghuffing

Ah. Another horrific event in NYC. Another week of webloggers' breathless "reporting." You can almost hear the smugness of tone, the underlying hope of validation: I hope I am right, because then I can say "I told you so." As if the last five decades of "traditional" news reporting will be somehow invalidated because of a handful of bloggers happened to stumble upon the correct conspiracy theory. Bloggers bicker and argue and post their daily affirmations ("You're the best kind of weblogger. Way to go!"), engage in serious, beard-stroking discussions of the "role" of weblogs and despair over how the use of the word synergy is bringing about the collapse of Western society through corporate oppression.

Meanwhile, on the other side of the world, music is being played in the streets for the first time in years, and women are shedding their burquas and are being told they can work and ride bicycles and go to school again, without fear.

Opera 6 Released

Opera 6 has been released. Highlights: SDI mode, Unicode, LiveConnect support, WAP/WML. Lowlights: still woefully incomplete DOM-2 and CSS-2 support.

November 9, 2001

Developer Day over

Well, all laptop and no connectivy makes Scott a dull blogger, further exacerbated by some obnoxious little minion snapping at us for trying to "scam our wireless network" simply because some of us had laptops open. Nice. Still, it was a good time. It's late, so I'll probably post Developer Day notes here over the weekend.

Developer Day is Today

I'm off to Mozilla Developer Day at the Netscape campus in a few minutes. I'll have a laptop with me, so I might try to blog some stuff here in true Scoble fashion. No guarantees, though. In any case, I'll post highlights of Developer Day here later on.

November 8, 2001

Your MT Blog as a Moreover feed

As you might know, I've been messing around with the Moveable Type system on this site. One thing I came up with is a way to generate a Moreover JavaScript feed of my DHTML-related posts. You can see the results here. It was a relatively obvious and brain-dead hack, but hey, small victories. If you're using MT, follow the MORE link to get the code. This template will create a Moreover JavaScript feed of your blog. If you or people you know use Moreover feeds on a website, now your blog can be one of them. I think it's particularly useful for blog categories; for example, I syndicate all the DHTML and JavaScript links I post as a separate feed.

Anyway, here's the deal:

1) Create a new Index Template. Name it something like "My Moreover JS Feed" or whatever.

2) Make sure you give the filename for this index a ".js" extension. Mine is "scottandrew.js"

3) Copy and paste the template code below:

function sa(url,headline_text,source,media_type,
  cluster,tagline,document_url,harvest_time,
  access_status,access_registration)
{
  this.url = url;
  this.headline_text = headline_text;
  this.source = source;
  this.media_type = media_type;
  this.cluster = cluster;
  this.tagline = tagline;
  this.document_url = document_url;
  this.harvest_time = harvest_time;
  this.access_status = access_status;
  this.access_registration = access_registration;
}
article = new Array();
<MTEntries lastn="5">
article[article.length] = new sa("<$MTEntryLink$>",
  "<$MTEntryTitle$>","<$MTBlogName$>","text",
  "<$MTEntryCategory$>","","<$MTBlogURL$>",
  "<$MTEntryDate$>","",""
  );
</MTEntries>


Make sure you leave in all that JavaScript at the top. You can increase or decrease the number of entries, or restrict it to only one category as I have:

<MTEntries lastn="5" category="DHTML, JavaScript and standards">

Also, if you use double quotes in your entry titles, be sure to escape them somehow so they don't break the sa() function (I just try to avoid double quotes).

4) Save and rebuild.

To display your blog posts, just use the same display code as you would for any other Moreover JS feed, and point the correct SCRIPT tag at your JS file.

You can see mine in action here:

http://www.scottandrew.com/mt_moreover.html

Ah, sweet DHTML

Eric has dug up some sweet DHTML links today, including endoflow, which reminds me of the early days of terrarium.nu. Whatever happened to terrarium, anyway? The URL is gone. Hmph.

And when did Aaron redesign his site? So cool, and all DHTML as far as I can tell.

Weblogs and global news

This article in the Sacramento Bee quotes my DHTML Bible co-author Steve Champeon on the role of weblogs in the realm of journalism:

"Most of us don't have journalism-school degrees or any real experience with journalistic principles," says Champeon. "You can't usually modify an institution from the outside, and you won't replace journalism with the occasional writings of amateurs."

There are already a number of established journalists who've recently started keeping weblogs (Dan Gillmor and Jeff Jarvis come to mind). But they're journalists first, bloggers second. Will the reverse ever be acceptable?

November 7, 2001

Fox Fall Season

The missing line from the series debut of 24:

Kiefer: "So, if I give you a phone number, can you find every Internet password associated with that number?"

Agency Geek Girl: "I sure can, thanks to Microsoft Passport!"

Most poignant line from the Simpsons' Halloween Special:

Homer: "Trusting every aspect of our lives to a giant computer was the best idea we've ever had!"

November 6, 2001

DynAPI 2.5.6 Released

DynAPI 2.5.6 is released. Primarily a maintence release. Word on the street is that DynAPI creator Dan Steinman is back and working on a new DynAPI version which may fork from the SourceForge project. I'm not sure how I feel about this. Not that it hasn't happened before; there are several DynAPI2 variants floating around out there, including Pascal's DynaCore and Mike Pemberton's AfroAPI (and not to mention the ill-fated, super-secret "Nemo" project developed by Brandon Myers and myself; alas, it is not available).

If developers are going to insist on calling their projects "DynAPI," I would hope that they would at least agree on a core set of methods and properties and stick with those. Not only would it keep previous widgets from breaking, it would be easier to migrate from one API to another if desired. I mean, I understand the strange developer compulsion to "do it all myself," but I generally frown on forking for the sake of wanting things your way.

November 5, 2001

Wouldn't that just suck?

So I was digging through my site error logs a day or so ago, noting with ire the large amount of 404 responses to Internet Explorer's relentless requests for favicon.ico. For the uninitiated, favicon.ico is the tiny graphic file that occasionally shows up next to the URL in IE's address bar. Then I started thinking, wouldn't it suck if IE required this tiny graphic in order to display the page? Then I thought, wouldn't it doubly suck if Microsoft (who owns the majority of browsers anyway) released a version of IE that required a special key to be placed on my site in order to view it through IE or the MSN browser at all?

Wouldn't it triply suck if I had to buy the key? Keep paying to renew the key?

56% of you are visiting this site with some version of IE.

Ping!

Ping! This is test of the weblogs.com notification system. And ping! This is also a test of the Moveable Type notification system.

Moveable Type 1.2

Moveable Type 1.2 is released.

November 3, 2001

On Web Design Thievery

Oh for Pete's sake.

Why is it that after five-plus years of design for the web, with all the absolutely free resources you can find out there, some people still think they can just pirate an entire site design down to the last pixel and pass it off as their own work. I mean, the freakin' stylesheet is still called "glish.css" for cryin' out loud.

It's almost laughable. I almost feel sorry for the floor company who probably paid mucho dinero to the bonehead(s) who "designed" the site. And I feel worse for Eric, who unknowingly did all the work for some loser and didn't see a dime. Never mind the fact that Eric has a ton of CSS layout templates available for free on his site they could have used.

XML For Everyone!

The first of several new features, as promised: an RSS feed of scottandrew.com. This site is now open for syndication. What? You mean you don't care for all my blathering and just want the DHTML/DOM/JavaScript stuff? No problem. There's an exclusive RSS feed for that too. You're welcome.

November 2, 2001

Reviews: Oysterhead and VoL

OysterheadSo I'm really perplexed about the new Oysterhead album. Oysterhead should have been a cross-generational/cross-genre music geek's dream: Trey Anastasio from Phish, Les Claypool from Primus, and Stewart Copeland from the Police. Musically competent, extremely tight. But it just doesn't gel. The majority of songs sound like Primus throwaways (with better production; I've never been a big Primus fan although Claypool has mad chops). The handful of Anastasio tunes are pure Phish with some interesting drum loops. And where is my man Stewart? His distinctive drumming is lost in the mess.

VoL: SummershineMy despondency is somewhat compounded by Summershine, the new album from Vigilantes of Love. As many reviewers have already pointed out, gone is the Americana-tinged roughness that made VoL great, and in its place is a shiny college pop sound straight outta 1984. In fact, several of the tunes ("Nothing New" and "Making It Up" come immediately to mind) sound startlingly like they belong on R.E.M's Murmur or Reckoning. It's not all bad, but it sounds forced if a bit defeated, as if Bill and the gang decided to find out how happily they could jangle. BTW, if you're not a VoL fan yet, grab a copy of their compilation CD.

ALA Alternate Stylesheets

Paul Sowden has an excellent article in the latest issue of AListApart on applying alternative stylesheets via JavaScript. Unlike the method used on this site, which document.write()s the proper style, Paul uses a completely DOM-based approach.

Glish returns

Glish is back, thank heavens.

DHTML UI Redux

OPTGROUP in action,  in a perfect worldMatthew McShane writes in to remind us that the infrastructure to create hierarchical menus with HTML has been around for years in the form of long-forgotten &lt;OPTGROUP&gt; element, which was supposed to add structure to &lt;SELECT&gt; and &lt;OPTION&gt; elements. Problem is, its never been supported by browsers as intended. The graphic on the right is how &lt;OPTGROUP&gt; might have been rendered, in perfect world where everything is wonderful.

November 1, 2001

Lost in our own backyard

Here's something I totally don't understand.

David L. Smith authored and released the Melissa virus in March of 2000 and was arrested one month later. Similarly, the culprit behind the "I Love You" virus was caught in the Philipines one month after releasing the virus in May. Yet we cannot seem to trace the source of a handwritten letter through the mail.

We know exactly where al-Qaida camps are (or were) located in remote regions of Afganistan, the location of ammo dumps and artillery depots, with pinpoint accuracy. Yet when we are told there is a "credible threat" against California suspension bridges, we aren't told whether or not we know which groups might be planning such an attack, where they are located or how they intend to do it.

I mean, in spite all the talk of fancy survelliance and warfare technology, it's almost like the US can't figure out where it last left the car keys.

Testing...testing...

Happy November. If you notice something a little strange going on here at scottandrew.com, please bear with us. I'm testing out a newly-installed, brand-spankin' new content management system (a gently hacked version of Moveable Type, to be precise). Not to worry, all of the articles and tutorials are still here, although at different URLs now, and any bookmarks you have should still work. There'll be some new features (such as the return of permanent links, below) introduced over the next few weeks which should make your visit all the more enjoyable. Really.

HierMenus and DHTML UI

Webreference has released an new revision of Peter Belesis' popular HierMenus DHTML menuing system, which contains improvements for IE6.

Dave Winer wonders why browser makers haven't provided an easy way to create such menus. It's a good question. A couple issues come to mind.

1. Standardization. We're still struggling to convince browser manufacturers to agree on and follow the W3C guidelines on such basic things as HTML and CSS. What hope do we have of getting them to implement a standard approach for creating menus? Microsoft is already moving forward with its Web Controls and Mozilla is already ahead of the curve with XUL.

2. Accessibility. A carefully designed DHTML menu should decompose into ugly but still-usable HTML when JavaScript and CSS is removed. I can't imagine the same happening with a proprietary menuing system, unless the HTML spec were expanded to include new items such as &lt;HIERMENU&gt; or &lt;MENUITEM&gt; as form elements. Which on its face doesn't appear to be a bad idea (to me).

I wonder if there has ever been any W3C discussion about expanding on UI HTML elements to include things like tabs, sliders and hierarchical menus. Hm, then again, that may violate the whole "separate content from [presentation | behavior]" thing that's all the rave these days.

Mozilla Developer's Day

The Mozilla Organization is holding a Developer Day event at the Netscape campus in Mountainview, CA next week. There's going to be a huge focus on JavaScript developers, with panels and discussions led by such luminaries as JavaScipt creator Brendan Eich and DHTML wunderkind Joe Hewitt. I'm particularly interested in learning more about XUL/XBL, Mozilla's XML-based system for UI and application development, which is often overlooked. And cheap! Admission is $15-$25 per person. I think I'll be there.