Can I pass $(this) to the .getJSON callback function? any workaround?
<p>I tried to get the value of rel on each li and pass it to the .getJSON function. I then want to add the thumbnail_url value from the callback to the image tag of the li descendants . My question is how could I pass the $(this) object to the callback function. It seems the $(this) is null.</p>

<pre><code>$('ul.sample li').each(function () {

        var url = 'http://sampleurl/api/url?' + $(this).attr('rel');

        $.getJSON(url, function (data){
            $(this).find('img').attr('src') = data.thumbnail_url;
    })
});
</code></pre>

<p>HTML:</p>

<pre><code>&lt;ul class="sample"&gt;
   &lt;li rel="value1"&gt;
       &lt;img src=""&gt;
   &lt;/li&gt;
   &lt;li rel="value2"&gt;
       &lt;img src=""&gt;
   &lt;/li&gt;
&lt;/ul&gt;
</code></pre>
