onclick instead of href
![]() ![]() |
Sometimes you already know the link won't work in Googledocs because it points to an intranet or requires authorization. Or you want to download the file directly, or open it in an external program. Or you don't want to leak the url to Google. Or you just want to bookmark the link or mail it to someone. The script could leave the href as it is and use an onclick event instead: l[i].setAttribute('onclick', 'window.open("http://docs.google.com/viewer?url=' + l[i].href + '"); return false'); or l[i].addEventListener('click', function(evt){
|

