Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
$.getJSON("/api/users/1") .then(function(user) { return $.getJSON("/api/orders?userId=" + user.id); }) .then(function(orders) { return $.getJSON("/api/items?orderId=" + orders[0].id); }) .then(function(items) { renderItems(items); }) .fail(function(err) { console.error("Chain failed:", err); });
Result
Open