Debian Codegraph @

examples/get/index.html

raw ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 <!doctype html>
2 <html>
3
4 <head>
5 <title>axios - get example</title>
6 <link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" />
7 </head>
8
9 <body class="container">
10 <h1>axios.get</h1>
11 <ul id="people" class="list-unstyled"></ul>
12
13 <script src="/axios.min.js"></script>
14 <script>
15 axios.get('/get/server')
16 .then(function (response) {
17 document.getElementById('people').innerHTML = response.data.map(function (person) {
18 return (
19 '<li class="row">' +
20 '<img src="https://avatars.githubusercontent.com/u/' + person.avatar + '?s=50" class="col-md-1"/>' +
21 '<div class="col-md-3">' +
22 '<strong>' + person.name + '</strong>' +
23 '<div>GitHub: <a href="https://github.com/' + person.github + '" target="_blank" rel="noopener noreferrer">' + person.github + '</a></div>' +
24 '<div>Twitter: <a href="https://twitter.com/' + person.twitter + '" target="_blank" rel="noopener noreferrer">' + person.twitter + '</a></div>' +
25 '</div>' +
26 '</li><br/>'
27 );
28 }).join('');
29 })
30 .catch(function (err) {
31 document.getElementById('people').innerHTML = '<li class="text-danger">' + err.message + '</li>';
32 });
33 </script>
34 </body>
35
36 </html>