Wrapping Things Up with JavaScript
That’s probably no secret for you, but I don’t quite like JavaScript: when it comes to use it, it always feels to me like I’m about to enter a world of deeply-buried secrets, where you have to deal with terrifying creatures which change of behaviour when exposed to any other browser – or magic powder.
However, the way Simon Willison uses JavaScript in this article to just wrap things up and bring the final nice “touches” really makes me enthiusastic.
First, he shows how to use the cite
attribute of blockquote
to render it as a link – a bit like here on Moz where this attribute appears below the quote itself, but not as a link. Then, he uses JavaScript to switch from one panel to another one. The demo doesn’t seem to be working but the solution he proposes looks quite elegant to me (something I didn’t think I would say about a JS script).
This might be useful to solve one problem I encounter while writing in here. When I type in the links for an article I cite, I always give a value to the accesskey
attribute. The problem is that a) I don’t display it (useless, then), and b) I often type the same keys since in a blog, you don’t quite have the choice. The solution for that is going to be JavaScript one, I feel it! ¶