detect if the user have an intention to redirect from it's page
<p>How can I detect if a user has any intention to leave his current page and redirect to any page from my website is their any javascript function that can handle this event I have more than 25 links in my page </p>

<pre><code>&lt;script type="text/javascript"&gt;
if(//user clicks a link )
 confirm("do you want to continue ?"); 

&lt;/script&gt;
</code></pre>

<p>Is their any javascript function that can check if the user click on any link on the page </p>
