Source

django-lastfm / templates / lastfm_widget / _widget.html

Full commit
<div id="lastfm">
<script type="text/javascript" charset="utf-8">
    $.getJSON("{% url lastfm %}",
        function(data) {
            $.each(data, function(i, item) {
                img = $("<img />").attr({
                        'src': item.img_url, 
                        'alt': item.title, 
                        'title': item.title
                })
                a = $("<a />").attr('href', item.url ).append(img)
                div = $("<div />").append(a)
                div.appendTo('#lastfm')
            });
        });
</script>
</div>