Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's for Google Analytics tracking of links. The links in the page use Javascript:

  <a onclick="goTracked(&quot;link-external&quot;, &quot;http://octopart.com/bb-bblk-000-circuitco+electronics-26478322&quot;);" class="external" href="#http://octopart.com/bb-bblk-000-circuitco+electronics-26478322" target="_blank">BeagleBone Black is readily available all over the world</a>
then the Javascript function in question:

  function goTracked(action, link) {
    ga('send', 'event', 'exit', action, link);
    setTimeout('document.location = "' + link + '"', 100);
  }
So, if you try to Cmd-Click a link to open it in a new tab (or middle-click, which is my preferred method), the target of the link is opened in a new tab. But the link's "href" target is just a fragment, so it opens the article in the new tab. 100 ms later, the current tab is redirected to the "actual" link target.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: