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

HTML Discussion :

Mot croisé en JavaScript, VBScript et DHTML*


Sujet :

HTML

  1. #1
    Membre averti
    Inscrit en
    Janvier 2004
    Messages
    20
    Détails du profil
    Informations forums :
    Inscription : Janvier 2004
    Messages : 20
    Par défaut Mot croisé en JavaScript, VBScript et DHTML*
    J'espère être dans le bon forum.

    J'ai ce script de mot croisé qui fonctionne très bien avec Explorer mais pas du tout avec Firefox, Netscape et Opera, la page reste blanche.

    avez-vous une piste à me suggèrer?

    Merci

    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
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
     
     
    <SCRIPT LANGUAGE="VBScript">
            
    Dim     cellChar(15,15)
            cellChar(1,1) = "NA1": cellChar(1,2) = "OB": cellChar(1,3) = "RC": cellChar(1,4) = "VD": cellChar(1,5) = "EE":cellChar(1,6) = "GF": cellChar(1,7) = "EG": cellChar(1,8) = " ": cellChar(1,9) = " ": cellChar(1,10) = "UJ": cellChar(1,11) = "LK": cellChar(1,12) = "RL": cellChar(1,13) = "IM": cellChar(1,14) = "KN": cellChar(1,15) = "AO"
     
            <!--toutes les cellules sont liste ici jusqu'à 15 -->          
     
            cellChar(15,1) = "R15": cellChar(15,2) = "O00": cellChar(15,3) = "U00": cellChar(15,4) = "G00": cellChar(15,5) = "E00": cellChar(15,6) = "N00": cellChar(15,7) = "T00": cellChar(15,8) = "E00": cellChar(15,9) = "R00": cellChar(15,10) = "R00": cellChar(15,11) = "E00": cellChar(15,12) = "M00": cellChar(15,13) = "E00": cellChar(15,14) = "N00": cellChar(15,15) = "T00"    
     
     
     
     
            Document.write ("<body bgcolor='#ceb55a' background='images/bg2.gif' bottommargin=100% leftmargin=1% rightmargin=1% bgproperties='fixed'>")
     
     
            Document.Write ("<form name='f1' method='POST' align='center'>")
            Document.Write ("<h1 align='center' style='width: 100%; )'><b>Mot croisé</font></b></h1>")
            Document.Write ("</div>")
            Document.Write ("<div  align='center' style='height: 1'><center>")
            Document.Write ("<table id='table1' border='0' width='500' height='500' cellspacing='1'>")      
     
                    idF = 0     
                    for i = 1 to 15
            Document.Write ("<tr>")
            Document.Write ("<td width='5' valign='middle' align='center' height='5' border='0'>&nbsp;</td>")
                    for j = 1 to 15
                            idF = idF + 1
                            numID = mid(cellChar(i,j),2,2)
                            bgCol = "white"
                            ftCol = "#632121"
                            inCol = "#ffffff"
                            if asc(cellChar(i,j)) = 32 then bgCol="black" : ftCol="#000000" : inCol="#000000" : end if
                            if numID = "00" then ftCol="#ffffff" end if
            Document.Write ("<td bgcolor=" & bgCol & " width='5' valign='bottom' align='center' height='5' style='border-style: solid; border-width: 1'>")
            Document.Write ("<p valign='top' align = 'left'><font face = 'Arial' size = '2' color = '" & ftCol & "'><sup>" & numID & "</sup></font>")
            Document.Write ("<input type = 'text'  name ='charAns" & idF & "' onChange='' size = '1' style = 'font-size:10pt; text-tranform:suppercase; background-color:" & inCol & ";font-weight:bold; text-align:center; border-style:solid; border-color=" & inCol & "; maxlength='1'></p>")
            
            Document.Write ("</td>")
                    next 
            Document.Write ("<td width='5' valign='bottom' align='center' height='5' border='0'>&nbsp;</td>")
            Document.Write ("</tr>")
                    next 
                    
            Document.Write ("</table></center>")
                    Document.Write ("</div></form>")
                    Document.Write ("</tr></table><p></p>")
            
            
            Document.Write ("<table align=center width=500>")
            Document.Write ("<center><tr>")
            Document.Write ("<td width=33%><p id='p1' align='center' style='filter: ; font-family: arial; font-variant: small-caps; font-weight: bold; font-size: 16;  cursor: hand; color: #632121' ><font onMouseOver=p1.style.color='#000000' onMouseOut=p1.style.color='#632121' onclick = 'reLoadPage()' >Essayer&nbsp;de<br>nouveau</legend></td>")
                    Document.Write ("<td width=33%><p id='p3' align='center' style='filter: ; font-family: arial; font-variant: small-caps; font-weight: bold; font-size: 16;  cursor: hand; color: #632121'><font onMouseOver=p3.style.color='#000000' onMouseOut=p3.style.color='#632121' onclick = 'chkBoard()' >Vérifier&nbsp;vos<br>réponses&nbsp;!</td>")
            Document.Write ("<td width=33%><p id='p2' align='center' font-family: arial; style='filter: ; font-variant: small-caps; font-weight: bold; font-size: 16;  cursor: hand; color: #632121'><font onMouseOver=p2.style.color='#000000' onMouseOut=p2.style.color='#632121' onclick = 'prvPage()' >Quitter</td>")
            
            Document.Write ("</tr></table><p></p>")
            Document.Write ("<table border=0 cellpadding=4 cellspacing=0 width=><tr valign=top>")
            Document.Write ("<td align=center></td>")
            Document.Write ("</td></tr></table>")
            Document.Write ("<table align=center border=0 width=600>")
            Document.Write ("<tr>")
            Document.Write ("<td width=50% height='0' border='0' ><b><font face='arial' size='4' color='#632121'>Horizontalement</font></b></td><td width=50% ><b><font face='arial' size='4' color='#632121'>Verticalement</font></b></td></tr>")
            Document.Write ("<tr><td border='0' valign='top'><font face='arial' size='-1' color='#000000'><b>")
            Document.Write ("1-A    Pays Scandinave.<br>" )
            
            <!--plein d'autre questions ici -->             
            
            Document.Write ("</p></td>")
            Document.Write ("<td width='50%' valign='top'><font face='arial' size='-1' color='#000000'><b>")
            Document.Write ("A-1    Mois du naufrage.<br>")
                    <!--plein d'autre questions ici -->             
                    Document.Write ("</p></td>")
       Document.Write ("</tr></table><p></p>")
                    
            
            
    Sub wrtVal()
           i = 1 
            for j = 6 to 15
            MsgBox " la police est  " & f1(2).value & "." & mid(cellChar(i,j),1,1)
            next
    End sub
     
    Sub prvPage()
            window.history.back 1
    End sub
     
    Sub chkBoard()
                                    k = 1
                    for i = 1 to 15 : for j = 1 to 15 : k = k + 1
                            if mid(cellChar(i,j),1,1) <> " " then
                                    retVal = strComp(f1(k).value, mid(cellChar(i,j),1,1), 1)
                            if retVal <> 0 then MsgBox " vous n'avez pas trouvé toutes les bonnes réponses", 48 : exit sub : end if 
                            end if
                                    y = y + 1
    <!--    MsgBox " Current number is  " & y & " " & f1(k).value-->
                    next : next
                            if y = 81 then MsgBox " !!!  BRAVO  !!! ", 64 : end if
    End sub
     
    Sub reLoadPage()
            document.url="motcroise.asp"
    End sub
     
            window.status ="Concours mot croisé Gunni le Gauche"
     
    <!--    window.open "http://www.edvlb.com/diandelacombe", "MSwindow", "toolbar=no", "resizeable=no" -->
    <!--           MsgBox "  " & navigator.appName & " " & navigator.appVersion & " "  -->
     
    </Script>

  2. #2
    Expert confirmé
    Avatar de Auteur
    Profil pro
    Inscrit en
    Avril 2004
    Messages
    7 657
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 7 657
    Par défaut
    bonsoir,

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    <SCRIPT LANGUAGE="VBScript">
    seul IE interprète le VBScript....

    avez-vous une piste à me suggèrer?
    convertir ce code en Javascript

  3. #3
    Membre averti
    Inscrit en
    Janvier 2004
    Messages
    20
    Détails du profil
    Informations forums :
    Inscription : Janvier 2004
    Messages : 20
    Par défaut
    Citation Envoyé par Auteur
    bonsoir,

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    <SCRIPT LANGUAGE="VBScript">
    seul IE interprète le VBScript....


    convertir ce code en Javascript
    mon dieu, comme la réponse est simple et comme j'aurai du m'en rendre compte lol

    merci

    et convertir cela, aie aie

  4. #4
    Membre Expert
    Avatar de trotters213
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    2 571
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : France, Gard (Languedoc Roussillon)

    Informations forums :
    Inscription : Janvier 2005
    Messages : 2 571
    Par défaut

    pense à cliquer sur en bas à droite si ton problème est résolu.

    PS : bonne chance pour la conversion

  5. #5
    Expert confirmé
    Avatar de Auteur
    Profil pro
    Inscrit en
    Avril 2004
    Messages
    7 657
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2004
    Messages : 7 657
    Par défaut
    mon dieu, comme la réponse est simple et comme j'aurai du m'en rendre compte lol
    Comment dois-je le prendre ?

    Voici des pistes
    VBScript :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
     
    Dim 	cellChar(15,15)
    	cellChar(1,1) = "NA1": cellChar(1,2) = "OB": cellChar(1,3) = "RC": cellChar(1,4) = "VD": cellChar(1,5) = "EE":cellChar(1,6) = "GF": cellChar(1,7) = "EG": cellChar(1,8) = " ": cellChar(1,9) = " ": cellChar(1,10) = "UJ": cellChar(1,11) = "LK": cellChar(1,12) = "RL": cellChar(1,13) = "IM": cellChar(1,14) = "KN": cellChar(1,15) = "AO"
     
    	<!--toutes les cellules sont liste ici jusqu'à 15 -->		
     
    	cellChar(15,1) = "R15": cellChar(15,2) = "O00": cellChar(15,3) = "U00": cellChar(15,4) = "G00": cellChar(15,5) = "E00": cellChar(15,6) = "N00": cellChar(15,7) = "T00": cellChar(15,8) = "E00": cellChar(15,9) = "R00": cellChar(15,10) = "R00": cellChar(15,11) = "E00": cellChar(15,12) = "M00": cellChar(15,13) = "E00": cellChar(15,14) = "N00": cellChar(15,15) = "T00"
    Javascript
    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
     
    var cellChar = new Array(new Array(15),new Array(15));
     
    cellChar[1][1] = "NA1";       cellChar[1][2] = "OB";    cellChar[1][3] = "RC";
    cellChar[1][4] = "VD";        cellChar[1][5] = "EE";    cellChar[1][6] = "GF";
    cellChar[1][7] = "EG";        cellChar[1][8] = " ";     cellChar[1][9] = " ";
    cellChar[1][10] = "UJ";       cellChar[1][11] = "LK";   cellChar[1][12] = "RL";
    cellChar[1][13] = "IM";       cellChar[1][14] = "KN";   cellChar[1][15] = "AO";
     
     
    cellChar[15][1] = "R15";    cellChar[15][2] = "O00";    cellChar[15][3] = "U00";
    cellChar[15][4] = "G00";    cellChar[15][5] = "E00";    cellChar[15][6] = "N00";
    cellChar[15][7] = "T00";    cellChar[15][8] = "E00";    cellChar[15][9] = "R00";
    cellChar[15][10] = "R00";   cellChar[15][11] = "E00";   cellChar[15][12] = "M00";
    cellChar[15][13] = "E00";   cellChar[15][14] = "N00";   cellChar[15][15] = "T00";

    VBScript
    javascript
    VBScript :
    boucles for et conditions if (=, <> , >=, =<, >,<)
    Javascript :
    Conditions : attention aux symboles de comparaison (==, != , >=, =<, >, <)

    VBScript :
    asc, mid etc...
    Javascript :
    voir l'objet String et les méthodes charAt(), fromCharCode(), substring() et indexOf() : +

    VBScript :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    Sub reLoadPage()
     
    End sub
    Javascript
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
     
    function reLoadPage()
    {
     
    }
    VBScript
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    	MsgBox " !!!  BRAVO  !!! "
    Javascript
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    alert( " !!!  BRAVO  !!! ");
    VBScript
    Javascript
    > Historique de navigation

    VBScript
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    	document.url="motcroise.asp"
    Javascript
    > recharger la page
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
     document.location.href="motcroise.asp"

    Remplacer les deux points séparant deux intructions VBScript par un point virgule en javascript.
    Javascript : chaque intruction se termine par un point virgule.
    Remplacer name par id du coup :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    onMouseOver='p2.style.color=....'
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    onmouseover="document.getElementById('p2').style.color=...."
    -événements écrits en minuscules
    -syntaxe JS : -utiliser les CSS
    -aérer le code
    -corriger l'orthographe
    -supprimer les aberrations :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    Document.Write("<body......")
    -et visiblement il manque un gros morceau dans ce code.......

Discussions similaires

  1. Réponses: 17
    Dernier message: 29/04/2008, 22h53
  2. [Javascript][VBScript]Détection de Fermeture de Fenêtre
    Par JohnBlatt dans le forum Windows
    Réponses: 1
    Dernier message: 24/01/2007, 17h09
  3. Problème de reconnaissance javascript vbscript
    Par mouste79 dans le forum Général JavaScript
    Réponses: 4
    Dernier message: 04/05/2006, 20h12
  4. cryptage assymetrique de mot de passe(javascript/PHP)
    Par chess132 dans le forum Général JavaScript
    Réponses: 11
    Dernier message: 25/10/2005, 14h04
  5. ASP,JavaScript,VBScript
    Par Zazeglu dans le forum ASP
    Réponses: 6
    Dernier message: 01/09/2003, 11h56

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