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
    Membre du Club
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    8
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2006
    Messages : 8
    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
    Membre du Club
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    8
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2006
    Messages : 8
    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 averti

    Inscrit en
    Juillet 2004
    Messages
    33
    D�tails du profil
    Informations forums :
    Inscription : Juillet 2004
    Messages : 33
    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
    Membre du Club
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    8
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2006
    Messages : 8
    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 Expert
    Inscrit en
    Septembre 2002
    Messages
    2 307
    D�tails du profil
    Informations forums :
    Inscription : Septembre 2002
    Messages : 2 307
    Par d�faut
    document.write
    :

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

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

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

    Informations forums :
    Inscription : Mars 2006
    Messages : 8
    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
    Membre du Club
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    8
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2006
    Messages : 8
    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