Small Flaw of Digg Podcasts

Digg Podcast

Now Digg is beta testing its “Podcasts” section. There is a module on the right of the page, with two tabs, “Find Podcast” and “Add New Podcast”.

Open the page and try clicking the tabs. You will discover the weird behaviors of this module.

Digg is using this single JavaScript function to handle the click events of the two tabs (Note that Prototype framework is used.):

function pcSwitchTabs(){
  var tab1 = $('podcastFind');
  var tab2 = $('podcastAdd');
  var addbox = $('podcast-add-box');
  var errordisplay = $('podcast-error-display');
  var ad = $('podcast_ad_switch');
  var psearch = $('podcast-search');
  var psubmit = $('podcast-submit');
  if (tab1.className == 'active') {
    tab1.className = '';
    tab2.className = 'active';
    if (addbox) { = 'block';

You should ignore several lines of unused code. What does this function do? As its name, it switches the tabs back and forth. And it’s called either of the tabs is clicked. So the weird thing happens – whichever tab you click on, the current tab changes. This can make users very confused.

Another thing is that when you click on a tab, the page scrolls back to the top after the tab switch. This will definitely make users lose their attention. The code for the click-able tab:

<a onclick="pcSwitchTabs()" href="#">Find Podcast</a>

After executing the onclick event handler code, the browser tries to open the link specified by the “href” attribute. A “#” makes the page scroll back to the top. There are some common solutions to this. For example, give href attribute a value of “javascript:void(0)” or append “return false” to onclick attribute to stop the event.

These two bugs are very easy to fix, but leaving them aside will definitely make users confused or unhappy. I don’t know how the beta process is going, but hope Digg will fix them one day.

1 comment

Leave a comment

Your email address will not be published. Required fields are marked *

Prove your intelligence before hitting * Time limit is exhausted. Please reload CAPTCHA.