lespetitshackers:nodejs:clienthtmldynamic
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
lespetitshackers:nodejs:clienthtmldynamic [2013/08/03 14:44] – [Exemple Serveur Web Requête REST en NodeJS] christian.jacolot | lespetitshackers:nodejs:clienthtmldynamic [2024/04/16 22:26] (Version actuelle) – modification externe 127.0.0.1 | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
+ | ====== Exemple Client HTML ====== | ||
+ | |||
+ | ===== Création de la page HTML dynamique du client ===== | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | |||
+ | < | ||
+ | <meta charset=" | ||
+ | < | ||
+ | |||
+ | <script type=' | ||
+ | function lirephrase() { | ||
+ | var url = " | ||
+ | var client = new XMLHttpRequest(); | ||
+ | client.open(" | ||
+ | client.setRequestHeader(" | ||
+ | client.send(); | ||
+ | console.log(" | ||
+ | if (client.status == 200) { | ||
+ | console.log(" | ||
+ | document.getElementById(' | ||
+ | } else { | ||
+ | console.log(" | ||
+ | } | ||
+ | } | ||
+ | |||
+ | function ajouter() { | ||
+ | var monmemo = document.getElementById(' | ||
+ | var url = " | ||
+ | var client = new XMLHttpRequest(); | ||
+ | client.open(" | ||
+ | client.setRequestHeader(" | ||
+ | client.send(" | ||
+ | console.log(" | ||
+ | if (client.status == 200) { | ||
+ | console.log(" | ||
+ | document.getElementById(' | ||
+ | } else { | ||
+ | console.log(" | ||
+ | } | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | < | ||
+ | <button onClick=" | ||
+ | < | ||
+ | <button onClick=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | |||