列出JSON数据?

How do i display the values that JSON returns?


function akaiphoneResponse(searchText){        
    $.ajax({
        type: "GET",
        url: Drupal.settings.basePath + 'akaiphone/response',
        data: 'search_text=' + searchText,
        success: function(data) {
      $("#search-results", this).empty(); 
      var jsob = jQuery.parseJSON(data.d);
      $.each(data, function(i, item){
        content = item.link + "-" + item.title ;

          $(content).appendTo("#search-results");

      });
        }
    });
}

JSON:


{"matches":[{"title":"JUR 3420 Forretningsjus","link":"6451"}]}

atm title is always gives "undefined", and link turns out "function link() {[native code]}" im a total noob at ajax and javascript, any help would be appreciated!

Try this as a replacement of your each function:

$.each(jsob.matches, function(i, item){
    content = item.link + "-" + item.title ;
    $(content).appendTo("#search-results");
});

Working example: http://jsfiddle.net/kGnJ2/