Skip to content
Justice Tech School

getJSON

getJSON loads and parses JSON.

Example
$.getJSON("/api/users", function (users) {
  $.each(users, function (i, u) {
    $("#list").append("<li>" + u.name + "</li>");
  });
});

Exercise

JSON shortcut.

$.JSON(url, fn)

Quiz Test

What does getJSON return to the callback?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.