How can I implement this Ajax script?
<p>This is a script that, when a link is clicked, will pull a page from somewhere
and insert it in a div in the current page. Pretty simple, yes, but being the
thick head I seem to be, I can't figure out how to implement it.</p>

<p>i.e. how can I formulate the link so that it will point the script to the page
I want to load in the div I want?</p>

<p>The script:</p>

<pre><code>$(document).ready(function() {  

    // Check for hash value in URL  
    var hash = window.location.hash.substr(1);  
    var href = $('#nav li a').each(function(){  
        var href = $(this).attr('href');  
        if(hash==href.substr(0,href.length-5)){  
            var toLoad = hash+'.html #content';  
            $('#content').load(toLoad)  
        }   
    });  

    $('#nav li a').click(function(){  

    var toLoad = $(this).attr('href')+' #content';  
    $('#content').hide('fast',loadContent);  
    $('#load').remove();  
    $('#wrapper').append('&lt;span id="load"&gt;LOADING...&lt;/span&gt;');  
    $('#load').fadeIn('normal');  
    window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5);  
    function loadContent() {  
        $('#content').load(toLoad,'',showNewContent())  
    }  
    function showNewContent() {  
        $('#content').show('normal',hideLoader());  
    }  
    function hideLoader() {  
        $('#load').fadeOut('normal');  
    }  
    return false;

    });
});
</code></pre>

<p>The instructions specify the following:</p>

<ol>
<li><p>We want to target the links within the navigation menu and run a function when they are clicked:</p>

<pre><code>$('#nav li a').click(function() {  
    // function here  
});
</code></pre></li>
<li><p>We need to define what page to get the data from when a link is clicked on:</p>

<pre><code>var toLoad = $(this).attr('href')+' #content';
</code></pre></li>
<li><p>The loadContent function calls the requested page:</p>

<pre><code>function loadContent() {  
    $('#content').load(toLoad,'',showNewContent)  
}
</code></pre></li>
</ol>

<p>It's very likely that the above is all that's needed to run the script as intended
but only if you know how to do it, which I don't.</p>

<p>PS: The tutorial all this comes from is <a href="http://net.tutsplus.com/javascript-ajax/how-to-load-in-and-animate-content-with-jquery/" rel="nofollow">here</a>.</p>
