metric - Dave's Blog

Search
My timeline on Mastodon

location.hash and location.search are bad and they should feel bad

2014 May 22, 9:25
The DOM location interface exposes the HTML document's URI parsed into its properties. However, it is ancient and has problems that bug me but otherwise rarely show up in the real world. Complaining about mostly theoretical issues is why blogging exists, so here goes:
  • The location object's search, hash, and protocol properties are all misnomers that lead to confusion about the correct terms:
    • The 'search' property returns the URI's query property. The query property isn't limited to containing search terms.
    • The 'hash' property returns the URI's fragment property. This one is just named after its delimiter. It should be called the fragment.
    • The 'protocol' property returns the URI's scheme property. A URI's scheme isn't necessarily a protocol. The http URI scheme of course uses the HTTP protocol, but the https URI scheme is the HTTP protocol over SSL/TLS - there is no HTTPS protocol. Similarly for something like mailto - there is no mailto wire protocol.
  • The 'hash' and 'search' location properties both return null in the case that their corresponding URI property doesn't exist or if its the empty string. A URI with no query property and a URI with an empty string query property that are otherwise the same, are not equal URIs and are allowed by HTTP to return different content. Similarly for the fragment. Unless the specific URI scheme defines otherwise, an empty query or hash isn't the same as no query or hash.
But like complaining about the number of minutes in an hour none of this can ever change without huge compat issues on the web. Accordingly I can only give my thanks to Anne van Kesteren and the awesome work on the URL standard moving towards a more sane (but still working practically within the constraints of compat) location object and URI parsing in the browser.
PermalinkComments

The Independent Gaming Source

2010 Jan 4, 2:22"A metric ton of fantastical and diverse games came out in 2009. Here are 20 of them"PermalinkCommentsgame videogame list

metric fuckton@Everything2.com

2009 Jan 26, 3:18PermalinkCommentsmeasurement unit metric humor

It's Me, and Here's My Proof: Why Identity and Authentication Must Remain Distinct

2009 Jan 22, 9:48"Revocation presents another challenge. If a system relies only on a biometric for both identity and authentication, how do you revoke that factor? Forgotten passwords can be changed; lost smartcards can be revoked and replaced. How do you revoke a finger?"PermalinkCommentsarticle microsoft security identity authentication biometrics

"Single?" Lawn Signs Conquer the American Landscape - The Metric System

2008 Nov 6, 6:27Examination of the who and why behind those 'Single?' lawn signs: 'At this point, I came to the realization that every question I answered seemed to introduce two more. In this case, they were "did someone hire these firms or are they acting on their own?" and, more confusingly, "how did a web design firm in Panama or India get a lawn sign physically planted in the front lawn of my high school in South Jersey?"'PermalinkCommentssign blog marketing dns advertising business web internet research

Excercise Bike and Tacoma Screw Products

2008 Jan 13, 11:07

Sarah and I got an exercise bike on sale and when attempting to put it together found that it was missing a bag of about ten different screws. The manufacturer website said we could order a replacement bag for thirty dollars (!!) but since the instructions listed the various kinds of screws we needed I figured we could just go to a hardware store and buy them.

We started at Home Depot because I didn't know better. The screws are all listed in metric sizes which is apparently uncommon and a helpful senior worker forwarded us to McLendons whose stock was better but we were again redirected this time to Tacoma Screw Products.

Tacoma Screw Products is great! See them for your hardware needs first! The store has a back area with every kind of screw ever. I felt a little out of place as as all the customers looked like contractors. The employee who helped me explained the various options I had in screws as the bike instructions weren't as explicit as they could have been. In the end I bought all my screws for only one dollar (much better than $30!) and they all fit correctly.

PermalinkCommentsscrew bike personal tacoma screw products nontechnical

Flickr patents "Interestingness ranking of media objects" (United States Patent Application: 0060242139)

2006 Nov 8, 12:57Abstract Media objects, such as images or soundtracks, may be ranked according to a new class of metrics known as "interestingness." These rankings may be based at least in part on the quantity of user-entered metadata concerning the media object, the nuPermalinkCommentsflickr interestingness patent patents law legal attention humor
Older Entries Creative Commons License Some rights reserved.