<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet">
<script type="text/javascript">
var testPromise = function() {
var delayBy = function(time, announce) {
/* function for emulating AJAX Call */
setTimeout(function() {
$(".announce").html(announce);
}, time);
}
$.ajax({
/* Your rad AJAX call */
}).done(delayBy(0, "1: First call!"))
.done(delayBy(3000, "2: Second call!"))
.done(delayBy(5000, "3: Third call!"));
}
</script>
</head>
<body>
<div class="announce alert alert-info"></div>
<button type="button" onclick="testPromise();" class="btn btn-primary" id="btnAnnounce">Run AJAX</button>
</body>
</html>
// Code goes here
/* Styles go here */