is it possible to make one click fires two events or more by javascript?

Posted by NewInAlbert on Stack Overflow See other posts from Stack Overflow or by NewInAlbert
Published on 2012-06-07T21:43:36Z Indexed on 2012/06/07 22:41 UTC
Read the original article Hit count: 172

Filed under:
|
|
|

I am currently making a temporary download page for website visitor.

The page includes a form, after the visitor fills the form up, the site will take them to the pdf download page.

In the download page, there are some pdf files download links (I am just using a tag.). However, i wanna make a onclick event to those links, once they have been clicked, the page will refresh automatically or redirect to other pages.

<a href="/file.pdf" onClick="window.location.reload()">The File</a>

I have tried the jquery way as well.

<a href="/file.pdf" id="FileDownload">The File</a>
<script>
   $("#FileDownload").click(function(){
         location.reload();
   });
</script>

But all the them are not working. Do you masters have any good ideas about this, many thanks.

P.S. What if I wanna add a countdown after a file is being started download, and then do page reload when countdown finishes.

Looks like have asked several questions... Thanks a ton in advance.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery