Print a specific attribute from an object within an AJAX retrieved object list?
<p>I'm using an AJAX call to return a list of objects from a database in JSON format.
These are then displayed as part of an autocomplete text input.
The problem is that I want to output/display the NAME attribute of each object within the list.</p>

<pre><code>$(function() {
    $("#ingredient-search").autocomplete({
        source : function(request, response) {
            $.ajax({
                url : "searchcontroller",
                type : "GET",
                data : {
                    term : request.term
                },
                dataType : "json",
                success : function(data) {
                    response(data);
                }
            });
        }
    });
</code></pre>

<p>The actual AJAX &amp; so on works fine. I'm just unsure how I can iterate through every element within 'data' and output the name attribute from each JSON object.</p>

<p>Thanks</p>