Bonjour, je me suis inspirer d'un chat existant.
Pouvez vous me dire si ma version fonctionne sur plusieurs postes clients.
Merci
Cela fonctionne sur mon ordinateur mais sans correspondants.
Code HTML : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37 <body> <fieldset> <legend>Un chat en jQuery</legend> <div class="conversation"></div><br /> <form action="#" method="post"> <input type="text" id="nom" value="pseudo" size="6"></br> <input type="text" id="message" size="35"> <button type="button" id="envoyer" title="Envoyer"><img src="envoyer.gif"></button> </form> </fieldset> <script> $(document).ready(function() { $('#envoyer').click(function() { var nom = $('#nom').val(); var message = $('#message').val(); afficheConversation(); }); function afficheConversation() { var ligne = $('#nom').val() + '>' + $('#message').val(); $(".conversation").append(ligne); $(".conversation").append("<br/>"); $('#message').val(''); $('#message').focus(); } }); </script> </body>
Partager