FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

XMLHttpRequest by pierangelomiceli · Pull Request #274 · javascript-tutorial/it.javascript.info · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension .html  (1) .js  (4) .md  (1) All 3 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
    • article.md
      • server.js
      • server.js
      • index.html
      • server.js
      • server.js
340 changes: 169 additions & 171 deletions 5-network/08-xmlhttprequest/article.md

Large diffs are not rendered by default.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function accept(req, res) {



// ----- запуск accept как сервера из консоли или как модуля ------
// ----- avvia il server ------

if (!module.parent) {
http.createServer(accept).listen(8080);
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var file = new static.Server('.', {
function accept(req, res) {

if (req.url == '/phones.json') {
// искусственная задержка для наглядности
// va un pochino in stallo per permettere di mostrare il messaggio di "loading"
setTimeout(function() {
file.serve(req, res);
}, 2000);
Expand All @@ -21,7 +21,7 @@ function accept(req, res) {
}


// ------ запустить сервер -------
// ------ avvia il server -------

if (!module.parent) {
http.createServer(accept).listen(8080);
Expand Down
4 changes: 2 additions & 2 deletions 5-network/08-xmlhttprequest/phones.view/index.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
xhr.send();

if (xhr.status != 200) {
// handle error
// gestisce l'errore
alert('Error ' + xhr.status + ': ' + xhr.statusText);
} else {
// show result
// mostra il risultato
alert(xhr.responseText);
}
}
Expand Down
4 changes: 2 additions & 2 deletions 5-network/08-xmlhttprequest/phones.view/server.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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
// va un pochino in stallo per permettere di mostrare il messaggio di "loading"
setTimeout(function() {
file.serve(req, res);
}, 2000);
Expand All @@ -21,7 +21,7 @@ function accept(req, res) {
}


// ------ запустить сервер -------
// ------ avvia il server -------

if (!module.parent) {
http.createServer(accept).listen(8080);
Expand Down
4 changes: 2 additions & 2 deletions 5-network/08-xmlhttprequest/post.view/server.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function accept(req, res) {
chunks.push(data);
length += data.length;

// More than 10mb, kill the connection!
// Per un contenuto maggiore di 10mb, termina la connessione!
if (length > 1e8) {
req.connection.destroy();
}
Expand Down Expand Up @@ -49,7 +49,7 @@ function accept(req, res) {
}


// ------ запустить сервер -------
// ------ avvia il server -------

if (!module.parent) {
http.createServer(accept).listen(8080);
Expand Down

Back | FazBrowse Home | New Git URL