mirror of
https://github.com/axios/axios.git
synced 2026-04-11 02:11:50 +08:00
* feat: implement prettier and fix all issues * fix: failing tests * fix: implement feedback from codel, ai etc * chore: dont throw in trim function Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> * fix: incorrect fix --------- Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
47 lines
1.3 KiB
HTML
47 lines
1.3 KiB
HTML
<!doctype html>
|
|
<html>
|
|
|
|
<head>
|
|
<title>axios - all example</title>
|
|
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" />
|
|
</head>
|
|
|
|
<body class="container">
|
|
<h1>axios.all</h1>
|
|
|
|
<div>
|
|
<h3>User</h3>
|
|
<div class="row">
|
|
<img id="useravatar" src="" class="col-md-1" />
|
|
<div class="col-md-3">
|
|
<strong id="username"></strong>
|
|
</div>
|
|
</div>
|
|
<hr />
|
|
<h3>Orgs</h3>
|
|
<ul id="orgs" class="list-unstyled"></ul>
|
|
</div>
|
|
|
|
<script src="/axios.min.js"></script>
|
|
<script>
|
|
axios.all([
|
|
axios.get('https://api.github.com/users/mzabriskie'),
|
|
axios.get('https://api.github.com/users/mzabriskie/orgs')
|
|
]).then(axios.spread(function (user, orgs) {
|
|
document.getElementById('useravatar').src = user.data.avatar_url;
|
|
document.getElementById('username').innerHTML = user.data.name;
|
|
document.getElementById('orgs').innerHTML = orgs.data.map(function (org) {
|
|
return (
|
|
'<li class="row">' +
|
|
'<img src="' + org.avatar_url + '" class="col-md-1"/>' +
|
|
'<div class="col-md-3">' +
|
|
'<strong>' + org.login + '</strong>' +
|
|
'</div>' +
|
|
'</li>'
|
|
);
|
|
}).join('');
|
|
}));
|
|
</script>
|
|
</body>
|
|
|
|
</html> |