Javascript: Interpolating variables inside strings
<p>I have the following jquery code which loads the <code>#content</code> div from <em>another</em> page, into the <code>#result</code> div on the <em>current</em> page:</p>

<pre><code>$('a').click(function(event){
  $('#result').load('abother_page.html #content');
});
</code></pre>

<p>As you can see, I'm hard-coding the name of the requested file, along with the specific div I want to display, into the string that is sent with the load method.</p>

<p>I'm trying to make this dynamic, but my code is missing something:</p>

<pre><code>// get the href of the link that was clicked
var href=$(this).attr('href');
// pass the href with the load method
$('#result').load('href #content');
</code></pre>

<p>Obviously this doesn't work because the href variable that i've created is not interpolated in the string. How can I do that? </p>

<p>I tried the following, all without success:</p>

<pre><code>// Ruby-style: 
$('#result').load('#{href} #content');
// Concatenating-style
$('#result').load(href + '#content');
</code></pre>
