Link to load external content into DIV
<p><a href="http://jsfiddle.net/9BCrs/5/" rel="nofollow">http://jsfiddle.net/9BCrs/5/</a></p>

<p>I have this set up to load a file into a DIV using the two links in the left DIV but it requires a unique copy of the same JQuery code each time there is a new link.</p>

<p>Is there a way of connecting the file being called and the DIV it is being called from to the link via some kind of variable maybe so that the code has to be included only once?</p>

<pre><code>$(function() {
$(".link1").click(function() {
    $(".load_space").load("helloworld.txt", function() {
        //Insert contents of file wherever
        $(".block1").stop(true, true).animate({ left: -400 }, 200);
        $(".block2").stop(true, true).animate({ left: 25 }, 200);
    });
});

$(".link2").click(function() {
    $(".load_space").load("hellouniverse.txt", function() {
        //Insert contents of file wherever
        $(".block1").stop(true, true).animate({ left: -400 }, 200);
        $(".block2").stop(true, true).animate({ left: 25 }, 200);
    });
});

$(".link3").click(function() {
    $(".block2").stop(true, true).animate({ left: 450 }, 200);
    $(".block1").stop(true, true).animate({ left: 25 }, 200);
});
});
</code></pre>
