This might help. No JQuery needed
<a href="../some-relative-link/file"
onclick="this.href = 'https://docs.google.com/viewer?url='+this.href; this.onclick = '';"
target="_blank">
This code does the following: Pass the relative link to Google Docs Viewer
this.href
So in your case this might work:
<a href="../some-relative-link/file"
onclick="this.href = 'javascript:'+console.log('something has stopped the link'); "
target="_blank">