Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: html, server.js 관련 번역
  • Loading branch information
gusdn3477 committed May 31, 2026
commit 2331790bb3a2d17bc88178585ba39651c542cb21
2 changes: 1 addition & 1 deletion 5-network/08-xmlhttprequest/example.view/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
}
</script>

<button onclick="run()">Load digits</button>
<button onclick="run()">숫자 불러오기</button>

<ul id="log"></ul>
10 changes: 5 additions & 5 deletions 5-network/08-xmlhttprequest/phones-async.view/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</head>
<body>

<button onclick="loadPhones()" id="button">Load phones.json!</button>
<button onclick="loadPhones()" id="button">phones.json 불러오기!</button>

<script>
function loadPhones() {
Expand All @@ -21,19 +21,19 @@
xhr.onreadystatechange = function() {
if (xhr.readyState != 4) return;

button.innerHTML = 'Complete!';
button.innerHTML = '완료!';

if (xhr.status != 200) {
// handle error
// 에러 처리
alert(xhr.status + ': ' + xhr.statusText);
} else {
// show result
// 결과 표시
alert(xhr.responseText);
}

}

button.innerHTML = 'Loading...';
button.innerHTML = '로딩 중...';
button.disabled = true;
}
</script>
Expand Down
8 changes: 4 additions & 4 deletions 5-network/08-xmlhttprequest/phones.view/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</head>
<body>

<button onclick="loadPhones()">Load phones.json!</button>
<button onclick="loadPhones()">phones.json 불러오기!</button>

<script>
function loadPhones() {
Expand All @@ -15,10 +15,10 @@
xhr.send();

if (xhr.status != 200) {
// handle error
alert('Error ' + xhr.status + ': ' + xhr.statusText);
// 에러 처리
alert('에러 ' + xhr.status + ': ' + xhr.statusText);
} else {
// show result
// 결과 표시
alert(xhr.responseText);
}
}
Expand Down
2 changes: 1 addition & 1 deletion 5-network/08-xmlhttprequest/phones.view/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let file = new static.Server('.', {
function accept(req, res) {

if (req.url == '/phones.json') {
// stall a bit to let "loading" message show up
// "로딩 중" 메시지가 보이도록 잠시 지연
setTimeout(function() {
file.serve(req, res);
}, 2000);
Expand Down
4 changes: 2 additions & 2 deletions 5-network/08-xmlhttprequest/post.view/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
const chunk = await reader.read();

if (chunk.done) {
console.log("done!");
console.log("완료!");
break;
}

chunks.push(chunk.value);
receivedLength += chunk.value.length;
console.log(`${receivedLength}/${contentLength} received`)
console.log(`${receivedLength}/${contentLength} 수신`)
}


Expand Down