Tsallaka zuwa abun ciki
Justice Tech School

JSON Data

getJSON fetches and parses JSON. Use it with each to build lists.

Example
$.getJSON('/api/users', function (users) {
  $.each(users, function (i, u) {
    $('ul').append('<li>' + $('<i>').text(u.name).html() + '</li>');
  });
});

Exercise

JSON helper.

$.JSON(url)

Quiz Test

Why escape user data?

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