А если так?
<a href="http://yandex.ru" target="_blank" onclick="return f();">nokia</a>
<script>
function factorial(n) {
return (n != 1) ? n * factorial(n - 1) : 1;
}
function f() {
try {
console.log( factorial(100) );
} finally{
return true;
}
}
</script>