使用jQuery遍历JSON

I have a standard AJAX request:

$.ajax({
  type: "POST",
  contentType: "application/json;",
  ...,
  success: function(data){

    // Wanna loop the resultList here...

  }
});

...which returns a JSON object which looks like this:

{
   "notification": "Search complete",
   "resultList": [
      {
         "id": 1,
         "comment": "lorem"
      },
      {
         "id": 2,
         "comment": "ipsim"
      },
      {
         "id": 3,
         "comment": "dolor"
      }
   ]
}

How do I loop though this with jQuery so that the following is printed in the log:
ID #1 - lorem
ID #2 - ipsum
ID #3 - dolor

Sorry for posting another one of these but I can't figure out how to print this without including the notification. Hopefully this will help others as well..

Pretty simple, you have an array of objects:

for (var i = 0; i < data.resultList.length; i++) {
    console.log(data.resultList[i].id);
}

Since you asked for jQuery answer, here's one just for fun:

$.each(foo.resultList, function(i, item) {
    console.log('ID #' + item.id + ' - ' + item.comment);
});