Some Handy YouTube Tricks

I’m sure there have been times when you’ve wanted to link to a particular part of a YouTube video but, if you’re anything like me, you had no idea how to go about doing so. Well, you have two options:

  1. You can link to the video on YouTube and specify the minute and second at which you want the video to start playing.
  2. You can embed the video and specify the second at which you would like the video to start playing.

Creating Usable Javascript Links

As I surf the Web, I come across countless Web sites that use one of the following methods to invoke a javascript function when someone clicks a link:

<a href="javascript:somefunction()">Click to invoke somefunction</a>

or

<a href="#" onclick="somefunction()">Click to invoke somefunction</a>

Unfortunately, these types of links are completely unusable for anyone with javascript disabled (and, for that matter, the second example is completely useless to people that can’t “click” the links, such as people using older handheld devices). Even worse, the second example can be extremely annoying, as it focuses the screen back to the top of the Web page when you click it.