lespetitshackers:nodejs:clienthtmldynamicjquery
Différences
Ci-dessous, les différences entre deux révisions de la page.
| lespetitshackers:nodejs:clienthtmldynamicjquery [2013/08/10 14:25] – créée christian.jacolot | lespetitshackers:nodejs:clienthtmldynamicjquery [2024/04/16 22:26] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | ====== Exemple Client HTML jQuery ====== | ||
| + | |||
| + | ===== Création de la page HTML dynamique du client avec jQuery ===== | ||
| + | |||
| + | < | ||
| + | < | ||
| + | < | ||
| + | |||
| + | < | ||
| + | <meta charset=" | ||
| + | < | ||
| + | <script src=" | ||
| + | <script type=' | ||
| + | |||
| + | var url = " | ||
| + | |||
| + | function lireliste() { | ||
| + | $.get(url, function(data) { | ||
| + | $('# | ||
| + | console.log(' | ||
| + | }); | ||
| + | } | ||
| + | |||
| + | function ajouter() { | ||
| + | var itemajouter = $("# | ||
| + | var sendInfo = { " | ||
| + | $.post(url, sendInfo); | ||
| + | console.log(" | ||
| + | } | ||
| + | |||
| + | function enlever() { | ||
| + | var itemajouter = $("# | ||
| + | var sendInfo = { " | ||
| + | $.ajax( | ||
| + | { | ||
| + | type: " | ||
| + | url: url, | ||
| + | data: sendInfo | ||
| + | } | ||
| + | ); | ||
| + | console.log(" | ||
| + | } | ||
| + | |||
| + | </ | ||
| + | |||
| + | </ | ||
| + | |||
| + | < | ||
| + | <button onClick=" | ||
| + | <div id=" | ||
| + | < | ||
| + | <button onClick=" | ||
| + | <div id=" | ||
| + | < | ||
| + | <button onClick=" | ||
| + | |||
| + | </ | ||
| + | </ | ||
| + | |||
| + | |||
| + | </ | ||
| + | |||
