Just give it a damn ID

I have a new pet-peeve: people that design websites poorly and don’t name or identify their elements.

Case in point: I visit a few trackers on my Sun Ray and with the very low resolution (1280×1024) I don’t fit much on the screen. That’s not a problem, right, because I can use Greasemonkey to run some extra Javascript for the giant search boxes on that page and have it set the display to none. But only if they identify the giant, obnoxious search box.

I could probably use getElementsByClassName(”box”) to return a bunch of the tables that use the “box” class and then set the correct one to display: none; but my Javascript-fu is not that strong. I want getElementById please.

3 Comments so far

  1. Tony on July 5th, 2008

    In theory you could use a bit of JavaScript CSS selector magic to make it easier to find those nodes in the page:
    http://www.joanpiedra.com/jquery/greasemonkey/
    http://docs.jquery.com/Selectors

    You can find elements with classes, attributes or “next to” type css things etc. JavaScript libraries are your friend :)

  2. Radford on July 6th, 2008

    Since when is 1280 x 1024 very low res?

  3. mlambie on July 6th, 2008

    Since developers of websites include search boxes that take 800 of those vertical pixels my friend.

Leave a Reply