ncyoung.com

Update: This part of my website is an archive of old content. Links may be broken, etc. home

alleviate confusing UE caused by high bandwidth

This entry is in the following categories:

Top->Happy Happy - Joy Joy
 - Older in Happy Happy - Joy Joy: Nathan's Markup Language (NML)
 - Newer in Happy Happy - Joy Joy: it's hard work

Top->How To
 - Older in How To: attach a new javascript or css include file to a page using javascript
 - Newer in How To: lego plans

Top->Programming->Web->JavaScript/DHTML
 - Older in JavaScript/DHTML:
 - Newer in JavaScript/DHTML: jQuery

Web users are used to having a significant delay after clicking on a link before the targeted page loads in the browser. Due to high bandwidht and fast processors, these delays can sometimes be nearly imperceptible, leading to confusion on the part of the end user.

To preserve the cognitive affordance that the loading delay causes, the following simple javascript can be used.


var linkList = document.getElementsByTagName("a");
for (i = 0; i < linkList.length; i++) {
  linkList[i].onclick = closeLinkFunction(linkList[i]);
}

function closeLinkFunction (linkNode){
  return function (){
    setTimeout('window.location = ' + "'" + linkNode.getAttribute('href') + "'", 1000);
    return false;
   }
}




For best results, make sure this script goes either at the bottom of the page or executed after page load.




Dated: 08/07/2006