Monthly Archives: May 2009

  • If javascript affects your UI, load it ASAP

    The javascript focus() method is often used to place a user’s cursor in the username field of a login form on page load. Twitter uses this technique. After everything is loaded, a blinking cursor appears in the username field and you can begin typing your login credentials. Viewing Twitter’s source code, you can see the jquery snippet that shifts the focus. It’s at the very bottom of the page and is loaded after several javascript libraries (why the hell do they use three separate javascript libraries?).

      jQuery(function($) {
        $('#username').focus();
      });

    It is advisable to place a script just before the closing tag </body> tag unless the script affects the user’s experience on load. The javascript focus() method affects ux. When I visit twitter from a shotty connection (like when my housemates are all bittorrenting at the same time), focus is shifted to the username field after I have already typed in my username and I’m halfway through the password field. I have to re-click the password field to finish what I started. It’s annoying. Load the script in the <head> or directly after the corresponding element. Or just don’t shift focus.

    Seriously, though, why does Twitter jQuery, Prototype and Scriptaculous? Old code? Or maybe they’re just really indecisive and like to keep their options open.

    Edit: They have since redesigned the homepage and now only use jQuery.

  • James Franco spends half an hour destroying his bedroom in Wholphin no. 8

    Wholphin no. 8 came in the mail yesterday. wholphin is a quarterly dvd magazine put out by McSweeney’s. Each issue is a dvd with ~ dozen short films from a variety of filmmakers.

    I love Wholphin. The films are (generally) completely absurd and extremely thought-provoking. Point-in-case: this latest issue has a 32 minute steady shot of James Franco destroying his bedroom. The film begins, franco enters the room, he spends half an hour systematically wrecking the entire room, fade to black, roll credits. It makes little sense, answers no questions, is painful to watch at times (as he kneels in broken glass), but it remains 100% captivating.

    I’ve yet to watch any other films on the dvd but they look equally promising (and more involved). The nice thing about Wholphin is that all the films are half an hour or shorter. They function more as inspirational mind fodder than entertainment. When I don’t have time for a two-hour feature-length movie I can watch a Wholphin short and feel just as satisfied.

    In fact, I’m usually sluggish and tired after watching feature-length films because my body shuts down from idleness. Feature films are like fast food: you enjoy them but you feel like shit afterward. Shorts films are like ordering a salad at lunch: your friends question your decision but damn it, you just feel like a salad.

  • I bought a neighborhood electric vehicle (NEV)

    Pictures to come. It’s a 2002 Ford Think neighbor. Essentially a beefy, street-legal, four-seater golf cart. 1,693 were made in 2002 before the line was discontinued and the remaining vehicles crushed. The Ford think city was featured in the documentary “who killed the electric car?”

    It has no doors and looks completely ridiculous. It’s classed as a low-speed vehicle and can not exceed 25mph. It can legally be driven on roads 35mph and under (nearly every street in San Francisco). It has a license plate and is registered and insured like any other vehicle. It’s 100% electric and I plug it into a standard 110 volt outlet to charge it at night. It gets 25 miles to the charge and costs $10/month in electricity.

    It is tons of fun. The previous owner installed a CD player and stereo system. I found a bike rack on the street and installed it. We drive around blaring chiptune. Travis and I drive to the bike kitchen with our bikes on the back. We go to costco without having to get a city carshare car. We can go to rainbow grocery and buy all the vegan food we want without having to haul stuff back on the bus.

    Wherever we go we park on the sidewalk and people assume the vehicle is owned by the city or a local university. No tickets, yet. I went to rsa at the Moscone Center. It was downtown San Francisco in the middle of the day and parking was completely impossible (as expected). I drove into the Terba Buena Gardens and parked in an outdoor walkway. No one said anything and I returned three hours later.

    I am lucky to live in a small city (San Francisco is only 7×7 miles) where such an obscure vehicle is practical. I encourage everyone in a similar situation to explore alternative means of transportation. Electric vehicles have superb acceleration and drive like a go-cart. Sooooo much fun.

  • Don’t let keyboard shortcuts hijack user experience

    One of the most frustrating aspects of myspace (and there a llloooottt of frustrating aspects) is the use of javascript keyboard shortcuts within their image viewing platform. When viewing an image from a user’s profile, hitting the left or right arrow on your keyboard will load the previous or following image, respectively.

    Here’s the problem: it prevents users’ from using their arrow keys for purposes other than browsing images. This is problematic because the thumb buttons on modern mice navigate backward and forward through browser history by emulating keystrokes (alt/cmd + arrow).

    Once a user clicks through to a myspace photo, attempts to traverse backward through browser history by clicking the ‘back’ thumb button prove fruitless. They have to manually click the ‘back’ arrow in their browser. This confuses the user and interrupts her experience.

    To make matters worse, some users (myself included) don’t have a ‘back’ arrow in their browser. I removed mine because I became so dependent on firefox’s keyboard shortcuts I found myself never using the ‘back’/'forward’ buttons. It allows more space for the location bar so I can read longer urls.

    The result is a blackhole. I navigate to a myspace photo album and can’t exit. I’m forced to open my browser history or right click > ‘back.’ It’s annoying and adds to the aggro myspace loves to evoke.

    All I ask for is an option to disable it. If you’re going to experiment with javascript keyboard shortcuts, please make them opt-out at the very least. Opt-in (a la gmail) is ideal, and whatever you do, do not require them. What is helpful to one person can be a pain in the ass to another.