Without using promises

by karim79

JavaScript

$.ajax({
     url: '/echo/html/',
     type: 'post',
     data: {
         html: "<em>Some crazy cool HTML</em>",
         delay: 3
     },
     success: function (html) {
         console.log("html from request 1: " + html);
         $.ajax({
             url: '/echo/html/',
             type: 'post',
             data: {
                 html: "<em>More crazy cool HTML</em>"
             },
             success: function (html) {
                 console.log("html from request 2: " + html);
             }
         });
     }
 });