jQuery: How do I pass a value into an Ajax call?
<p>I am updating some div as follows:</p>

<pre><code>for(var i = 0; i &lt; data.length; i++) {
    var query = base_url + data[i];
    $.ajax({
        url: query,
        type: 'GET',
        dataType: 'jsonp',
        timeout: 2000,
        error: function() { self.html("Network Error"); },
        success: function(json) {
            $("#li" + i).html("&lt;img src='" + json.result.list[0].url + "' /&gt;")
        }
    });
}
</code></pre>

<p>The value of i does not work inside the ajax call. I am trying to pass the value of i so that it can attach the element to the proper div. Can someone help me out?</p>
