jQuery .load(jQuery(this).attr("id")) vs .load("theID") - how to translate?
<p>I have a list (menu). When user clicks on link, I want to load content with ajax. The article to be loaded is to be determined based on the links id attribute. </p>

<p>example:</p>

<pre><code>&lt;ul class="ajaxMenu"&gt;
    &lt;li&gt;&lt;a id="services"&gt;Services&lt;/a&gt;
    ...
&lt;/u&gt;
</code></pre>

<p>the variables where I store the links to the article, are named the same as the links' id (i.e. Services and the url for the ajax call is stored on var services)</p>

<p>This works:</p>

<pre><code>var services = "index.php?option=com_content&amp;view=article&amp;id=2&amp;tmpl=component";

jQuery(".ajaxMenu &gt; li &gt; a ").click( 
        function(event) { 

            jQuery("#contentComponent").load(services);

        }

    );
</code></pre>

<p>Since this line of code <strong>jQuery(this).attr("id")</strong> gives me id, I was hoping this would work [it did not work]:</p>

<pre><code>var services = "index.php?option=com_content&amp;view=article&amp;id=2&amp;tmpl=component";
var designs = "index.php?option=com_content&amp;view=article&amp;id=3&amp;tmpl=component";
var contact = "index.php?option=com_content&amp;view=article&amp;id=2&amp;tmpl=component";

jQuery(".ajaxMenu &gt; li &gt; a ").click( 
        function(event) { 

            jQuery("#contentComponent").load(jQuery(this).attr("id"));

        }

    );
</code></pre>

<p>I could create an if, or a loop, iterate through each var, (i.e. if <em>jQuery(this).attr("id") == "services"...load(services)</em>)</p>

<p>but I suspect I can achieve this with simple elegant code.</p>

<p>How could I translate jQuery(this).attr("id") into the .load() function without having to if, loop, etc., the value of jQuery(this).attr("id") against the named variables where I stored the urls to be loaded?</p>
