Trying to build jquery interstital div, but no action when clicking on link
<p>I am trying to build the following action using jquery:
when a user clicks on a link, the mainContent div is hidden and the exitSite message is shown. The user then has two choices: to return to the main content or to proceed and leave the site.</p>

<p>The current issue: when clicking a link that will leave the site, nothing happens.</p>

<p>Here is the code I have so far: </p>

<p>the JQuery: </p>

<pre><code>$(function(){

if($('div#exitSite'))
{
    var mydomain$ = location.hostname;
    var links = $('a').each(function()
    {
        if((this.href.indexOf("mySiteDomain")==-1) &amp;&amp; (this.href.indexOf(mydomain$)==-1) &amp;&amp; (this.href.indexOf("javascr")==-1))
            $(this).addClass('exit');
    });

    /*Off site links.*/     
    $('a.exit').live('click', function (e) {
        e.preventDefault(); //stop the click from going through.
        var page = $(this).attr("href") //get destination page
        var pagetitle = $(this).attr("title")

        $('#mainContent').hide(); //hide main content window
        $('#mainContent').show(); //show main content window

        $('#exitSiteClose').click(function() { 
            $('#exitSite').hide();
            $('#mainContent').show();
            return false
            }); // end click #exitSiteClose

        $('#exitSiteContinue').click(function() {
            window.location=page
            //if user selects the continue button, then pass in the destination page from link.
            }); // end click #exitSiteContinue      
    });// end click a.exit  
}
});
</code></pre>

<p>the html:</p>

<p>link leaving site: 
    <a href="http://www.stackoverflow.com">click to stackoverflow.com</a></p>

<p>the exit site div:</p>

<pre><code>&lt;div id="exitSite"&gt;
&lt;h2&gt;Hello!&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;You are leaving this website&lt;/strong&gt;&lt;/p&gt;
    &lt;div class="buttonContainer"&gt;
    &lt;a href="#" id="exitSiteClose" class="btn-gray"&gt;Cancel&lt;/a&gt;
    &lt;a href="#" id="exitSiteContinue" class="btn-blue"&gt;Continue&lt;/a&gt;
&lt;/div&gt;&lt;!-- /.buttonContainer --&gt;
&lt;/div&gt;&lt;!-- /#exitSite --&gt;
</code></pre>
