HTML Fragment Linking Is Stupid - Here's The Fix


Link to...HERE!!1
(click to enlarge)

Sure, the concept is all good, but the way it works is completely fucking ass-backwards. If I weren't such a curmudgeon about web "technologies", I'd be astonished that it still hasn't been fixed, two decades later (!), with modern HTML5.

Here's how linking works: You see something, you want to link to it, and...you make a link to it. Duh.

Ie, it's all on the linker's initiative. It doesn't have a thing to do with the linkee. The person making a link decides what they want to link to. Obviously.

So why the shit is it up to the person being linked to to set the possible link targets (via id= or name=)? They're not the one doing the fucking linking!

What's needed are enhanced URL fragments capable of accepting not just an id or name, but a proper CSS selector. Why the hell isn't this already in at least some version of the HTML standard?

When I started writing this, I did a quick sanity check to see if, hopefully, I might have been mistaken and such a thing already existed in the standards. It doesn't. However, it seems other people do have the same good sense.

I like that guy's proposal. It's simple, no bullshit, it would work, and there's even a few browser extensions implementing it. It works like this:

http://example.com/lorem.html#css(.content:nth-child(2))

Or:

http://example.com/lorem.html#css(.content:nth-child(2))css(#alternate1)css(.alt2)

There. Done. It's easy. It would work. There's (small) precedent. And it's something we should have had ages ago. Only problem is, it will never gain traction as a mere non-standard browser extension.

It's time to pressure W3C to get off their lazy red-tape-bondaged asses and put this into the spec.

You know what? Fuck the W3C. Go pressure browser vendors directly to put this shit in, natively - standards or not.

2 comments for "HTML Fragment Linking Is Stupid - Here's The Fix"

  1. (Guest) arizvisa
    2012-06-01 19:54

    unfortunately, the security industry would whine and complain about this due to that feature allowing for someone to inject a css action into a webpage in a completely different domain (same origin policy). although i'm all for it, because i think the web should evolve into some world-wide-chaotic-web instead of the few islands that it's become.

  2. 2012-06-07 22:32

    These would merely be CSS *selectors*, not full CSS. Ie, there would be no CSS properties/actions, therefore no injection of any kind would be possible.

    But I do agree with your complaint about the web degenerating into isolated islands. At least, I assume you're referring to the walled-off "sub-webs" like twitface, github, linkedin and such that try to be their own centralized platforms rather than be proper open-protocols (ex: ftp/smtp/nntp/jabber/torrent/etc) like what the internet used to be primarily made of.

Leave a comment

Captcha