-
Notifications
You must be signed in to change notification settings - Fork 0
/
example1.improved.html
52 lines (51 loc) · 1.41 KB
/
example1.improved.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Promises - Webmontag 12.05.2014</title>
<link rel="stylesheet" type="text/css" href="assets/bootstrap/dist/css/bootstrap.min.css">
</head>
<body>
<article class="container">
<h1 id="title"></h1>
</article>
<script src="assets/js/spin.min.js"></script>
<script src="assets/js/jquery-1.10.1.min.js"></script>
<script>
jQuery(function ($) {
"use strict";
$.ajax({
url: 'http://127.0.0.1/webmontag/helloWorld.txt',
dataType: 'html'
})
.then(function (data) {
$('#title').text(data);
},
function (xhr, textStatus) {
return $.ajax({
url: 'http://127.0.0.1:8080/webmontag/helloWorld.txt',
dataType: 'html'
});
})
.then(function (data) {
$('#title').text(data);
},
function (xhr, textStatus) {
return $.ajax({
url: 'http://127.0.0.1:8081/webmontag/helloWorld.txt',
dataType: 'html'
});
})
.then(function (data) {
$('#title').text(data);
},
function (xhr, textStatus) {
console.log("Fail hard");
debugger;
});
})
</script>
</body>
</html>