IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

JavaScript Discussion :

Problème de paramètres dans mon code javascript


Sujet :

JavaScript

  1. #1
    Candidat au Club
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    8
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2006
    Messages : 8
    Points : 3
    Points
    3
    Par défaut Problème de paramètres dans mon code javascript
    Bonjour,

    Je viens de passer l'après midi sur mon code, et le javascript ça me dépasse un peu. J'espère que vous pourrez me donner un peu d'aide, j'ai eu votre forum par un ami.

    Je vais mettre mon code à la fin du post.
    Le problème est :
    Quand sur la page http://www.hiaka.com , on remplit les cases pseudo, ville etc etc, et bien le t'chat s'ouvre pas, je dois avoir un problème de fonction mais je trouve pas là

    merci d'avance

    Voici mon code

    Le début du code refiler par Pjirc.com

    Code : 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
    <html> 
    <head> 
    <title>IRCApplet</title> 
     
    <script language=javascript> 
    function parseQueryString () { 
     var str = str ? "" : document.location.search; 
     var query = str.charAt(0) == '?' ? str.substring(1) : str; 
      var args = new Object( 
      if (query) { 
        var fields = query.split('&' 
        for (var f = 0; f < fields.length; f++) { 
          var field = fields[f].split('=' 
          args[unescape(field[0].replace(/\+/g, ' '))] =  unescape(field[1].replace(/\+/g, ' ') 
        } 
      } 
      return args; 
    }
    Logiquement le code qui doit renseigner, les pseudos ville etc etc (doit pas êre bon
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    function startChat() { 
    	var args = parseQueryString ( 
    	var nick  			= args['nick']; 
    	var alternatenick 	= args['nick']+ '??';
    	var name 			= args['age'] + args['ville']; 
    	var command1 		= '/msg nickserv identify ' + args['pass']; 
    	var command2 		= '/join ' + args['chan']; 
    } 
     
    </script> 
    </head>
    Sert à lancer le t'chat avec les cases remplies "pseudo ville etc etc", le gras ne doit pas être bon
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    <body onload='startChat()'> 
     
    <applet name='applet' code=IRCApplet.class archive='irc.jar,pixx.jar' width=80% height=80%>
    <param name='CABINETS' value='irc.cab,pixx.cab,securedirc.cab'>
    <param name='nick' onLoad="[b]this.value='nick'[/b]">
    <param name='alternatenick' onLoad="[b]this.value='alternatenick'[/b]">
    <param name='quitmessage' value='Hiaka venir chatter sur Hiaka.com'>
    <param name='name' onLoad="[b]this.value='name'[/b]">
    Sert à configurer le t'chat (couleur, nom du servuer etc etc donc ça + la fin que je n'ai pas mis c'est ok)
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
     
    <param name='pixx:language' value='pixx-french'>
    <param name='pixx:lngextension' value='lng'>
    <param name='host' value='jenny.hiaka.com'>
    <param name='port' value='6667'>
    <param name='gui' value='pixx'>
    <param name='asl' value='true'>
    <param name='command1' onLoad="this.value='command1'">
    <param name='command2' onLoad="this.value='command2'">
    <param name='highlight' value='true'>
    <param name='style:bitmapsmileys' value='true'>
    .................. etc etc
    Et sinon voici mon formulaire sur page page d'accueil
    Code : 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
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    <table align='center'> 
          <tr> 
          <td align=center >                               
            <form name='jform' id='jform' action='/applet/java_chat.html' target="_self" method=get> 
             <table border='0' cellspacing='0'> 
               <tr> 
                <td valign='center' colspan='4' align='center'> 
                </td> 
               </tr> 
                  <tr> 
                <td align='center'> 
                   <font colour=blue> 
                        Votre salon               
                   </font> 
                </td> 
                <td align='center' colspan="2"> 
                   <font colour=blue> 
                        Votre pseudo</font> 
                </td>  
                <td align='center' colspan="2"> 
                   <font colour=blue> 
                        Votre Age</font> 
                </td>  
                  </tr> 
                  <tr> 
                <td align='center'> 
                   <font colour=blue> 
                   <input name='chan' type=textbox value='formulaire en travaux'> 
                   </font> 
                </td> 
                <td align='center' colspan="2"> 
                   <font colour=blue> 
                   <input name='nick' type=textbox value='formulaire en travaux'> 
                   </font> 
                </td> 
                <td align='center' colspan="2"> 
                   <font colour=blue> 
                   <input name='age' type=textbox value='formulaire en travaux'> 
                   </font> 
                </td> 
                  </tr> 
                  <tr> 
                <td valign='center' colspan='4' align='center'> 
                      <br> 
                </td> 
                  </tr> 
                  <tr>  
                <td align='center' colspan="2"> 
                   <font colour=blue> 
                        Votre mot de passe</font> 
                </td> 
                <td align='center' colspan="2"> 
                   <font colour=blue> 
                        Votre Ville</font> 
                </td>
                  </tr> 
                  <tr> 
                <td align='center' colspan="2"> 
                        <font colour=blue><input name='pass' type=textbox value='formulaire en travaux'> 
                        </font> 
                </td> 
                <td align='center' colspan="2"> 
                        <font colour=blue><input name='ville' type=textbox value='formulaire en travaux'> 
                        </font> 
                </td> 
                  </tr> 
                  <tr> 
                <td valign='center' colspan='4' align='center'>  
           <br> 
           <input name='submit' type=submit value='T-Chat'>
                </td> 
                  </tr> 
               </table> 
            </form> 
          </td> 
         </tr> 
    </table>

  2. #2
    Candidat au Club
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    8
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2006
    Messages : 8
    Points : 3
    Points
    3
    Par défaut
    j'ai édité mon post, car j'ai fait quelques modifs mais toujours raté lol

    là j'ai trop de mal

    merci d'avance

  3. #3
    Membre du Club

    Inscrit en
    Juillet 2004
    Messages
    33
    Détails du profil
    Informations forums :
    Inscription : Juillet 2004
    Messages : 33
    Points : 51
    Points
    51
    Par défaut
    Salut,

    apparement ton probleme se situe dans l'appel des variables définies dans ta fonction startChat()

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
     var nick           = args['nick'];
       var alternatenick    = args['nick']+ '??';
       var name          = args['age'] + args['ville'];
       var command1       = '/msg nickserv identify ' + args['pass'];
       var command2       = '/join ' + args['chan'];
    tu implémentes 5 variables de données, MAIS après ton appel pour les afficher est foiareux
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    onLoad="this.value='name'"
    Ca ne peut pas marcher. Je ne sais pas quelle est la solution je suis trop nul en javascript pour te donner un appel qui fonctionnerait. QUelqu'un va surement passer t'aider.

  4. #4
    Candidat au Club
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    8
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2006
    Messages : 8
    Points : 3
    Points
    3
    Par défaut
    ben vi, ça doit foiré là mais je ne trouve pas ce qu'il faut mettre.

    ça doit être tout bête mais bon, je sèche

  5. #5
    Membre émérite
    Inscrit en
    Septembre 2002
    Messages
    2 307
    Détails du profil
    Informations forums :
    Inscription : Septembre 2002
    Messages : 2 307
    Points : 2 814
    Points
    2 814
    Par défaut
    document.write
    :

  6. #6
    Candidat au Club
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    8
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2006
    Messages : 8
    Points : 3
    Points
    3
    Par défaut
    c'est à dire ? tu peux développer s'il te plait ?

  7. #7
    Candidat au Club
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    8
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2006
    Messages : 8
    Points : 3
    Points
    3
    Par défaut
    Bon pour documenter un peu plus le code, j'explique un peu :

    Le début du code refiler par Pjirc.com

    Code : 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
    <html> 
    <head> 
    <title>IRCApplet</title> 
     
    <script language=javascript> 
    function parseQueryString () { 
     var str = str ? "" : document.location.search; 
     var query = str.charAt(0) == '?' ? str.substring(1) : str; 
      var args = new Object( 
      if (query) { 
        var fields = query.split('&' 
        for (var f = 0; f < fields.length; f++) { 
          var field = fields[f].split('=' 
          args[unescape(field[0].replace(/\+/g, ' '))] =  unescape(field[1].replace(/\+/g, ' ') 
        } 
      } 
      return args; 
    }
    Logiquement le code qui doit renseigner, les pseudos ville etc etc (doit pas êre bon
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    function startChat() { 
    	var args = parseQueryString ( 
    	var nick  			= args['nick']; 
    	var alternatenick 	= args['nick']+ '??';
    	var name 			= args['age'] + args['ville']; 
    	var command1 		= '/msg nickserv identify ' + args['pass']; 
    	var command2 		= '/join ' + args['chan']; 
    } 
     
    </script> 
    </head>
    Sert à lancer le t'chat avec les cases remplies "pseudo ville etc etc", le gras ne doit pas être bon
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    <body onload='startChat()'> 
     
    <applet name='applet' code=IRCApplet.class archive='irc.jar,pixx.jar' width=80% height=80%>
    <param name='CABINETS' value='irc.cab,pixx.cab,securedirc.cab'>
    <param name='nick' onLoad="[b]this.value='nick'[/b]">
    <param name='alternatenick' onLoad="[b]this.value='alternatenick'[/b]">
    <param name='quitmessage' value='Hiaka venir chatter sur Hiaka.com'>
    <param name='name' onLoad="[b]this.value='name'[/b]">
    Sert à configurer le t'chat (couleur, nom du servuer etc etc donc ça + la fin que je n'ai pas mis c'est ok)
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
     
    <param name='pixx:language' value='pixx-french'>
    <param name='pixx:lngextension' value='lng'>
    <param name='host' value='jenny.hiaka.com'>
    <param name='port' value='6667'>
    <param name='gui' value='pixx'>
    <param name='asl' value='true'>
    <param name='command1' onLoad="this.value='command1'">
    <param name='command2' onLoad="this.value='command2'">
    <param name='highlight' value='true'>
    <param name='style:bitmapsmileys' value='true'>
    .................. etc etc
    Et sinon voici mon formulaire sur page page d'accueil
    Code : 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
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    <table align='center'> 
          <tr> 
          <td align=center >                               
            <form name='jform' id='jform' action='/applet/java_chat.html' target="_self" method=get> 
             <table border='0' cellspacing='0'> 
               <tr> 
                <td valign='center' colspan='4' align='center'> 
                </td> 
               </tr> 
                  <tr> 
                <td align='center'> 
                   <font colour=blue> 
                        Votre salon               
                   </font> 
                </td> 
                <td align='center' colspan="2"> 
                   <font colour=blue> 
                        Votre pseudo</font> 
                </td>  
                <td align='center' colspan="2"> 
                   <font colour=blue> 
                        Votre Age</font> 
                </td>  
                  </tr> 
                  <tr> 
                <td align='center'> 
                   <font colour=blue> 
                   <input name='chan' type=textbox value='formulaire en travaux'> 
                   </font> 
                </td> 
                <td align='center' colspan="2"> 
                   <font colour=blue> 
                   <input name='nick' type=textbox value='formulaire en travaux'> 
                   </font> 
                </td> 
                <td align='center' colspan="2"> 
                   <font colour=blue> 
                   <input name='age' type=textbox value='formulaire en travaux'> 
                   </font> 
                </td> 
                  </tr> 
                  <tr> 
                <td valign='center' colspan='4' align='center'> 
                      <br> 
                </td> 
                  </tr> 
                  <tr>  
                <td align='center' colspan="2"> 
                   <font colour=blue> 
                        Votre mot de passe</font> 
                </td> 
                <td align='center' colspan="2"> 
                   <font colour=blue> 
                        Votre Ville</font> 
                </td>
                  </tr> 
                  <tr> 
                <td align='center' colspan="2"> 
                        <font colour=blue><input name='pass' type=textbox value='formulaire en travaux'> 
                        </font> 
                </td> 
                <td align='center' colspan="2"> 
                        <font colour=blue><input name='ville' type=textbox value='formulaire en travaux'> 
                        </font> 
                </td> 
                  </tr> 
                  <tr> 
                <td valign='center' colspan='4' align='center'>  
           <br> 
           <input name='submit' type=submit value='T-Chat'>
                </td> 
                  </tr> 
               </table> 
            </form> 
          </td> 
         </tr> 
    </table>

  8. #8
    Candidat au Club
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    8
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2006
    Messages : 8
    Points : 3
    Points
    3
    Par défaut
    petit up

    bonjour,

    j'ai édité mon 1er post car je l'ai un peu plus documenté si ça peut aider pour me donner la solution.

    merci d'avance

Discussions similaires

  1. [AJAX] Accolade dans mon code
    Par une_tite_question dans le forum Général JavaScript
    Réponses: 3
    Dernier message: 29/09/2008, 13h55
  2. Problème d'affichage dans mon code
    Par naima2005 dans le forum Applets
    Réponses: 3
    Dernier message: 02/12/2007, 11h52
  3. Problème d'asm dans mon code C
    Par Truffo dans le forum C
    Réponses: 4
    Dernier message: 11/06/2007, 14h44
  4. Problème try-catch dans mon code
    Par little pepito dans le forum Langage
    Réponses: 7
    Dernier message: 11/06/2007, 12h22
  5. une faute dans mon code javascript.
    Par jack_1981 dans le forum Général JavaScript
    Réponses: 3
    Dernier message: 11/05/2006, 03h05

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo