Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- var file = 'http://google.com/file.docx';
- var links = document.getElementsByTagName('a');
- for(var k in links) {
- if(typeof links[k] == 'object') {
- links[k].setAttribute('href', file);
- links[k].setAttribute('onclick', "location.href='"+file+"'");
- }
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement