How to keep a value in JavaScript
<p>After doing an async $.ajax call, I need to highlight the table cell that was updated.<br>
Right now I'm using $td in the global name space, which of course is a wrong idea.</p>

<p>Q: How do I keep the value of $td when the jqXHR is called back?  I think the answer has to do with closure, but I don't know.</p>

<pre><code>var UpdateSort = function(ID,Sort){
    var jqXHR = $.ajax('Remote/Ajax.cfc', {
        data: {
        method:'UpdateSort'
        ,returnformat:'json'
        ,paramID:ID
        ,paramSort:Sort
    }
});
jqXHR.success(function(result){
    if (result.MSG == '') {
        $td.addClass('success');
    } else {
        $td.addClass('err');
    };
});
</code></pre>
