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 :

Aide pour un code javascript


Sujet :

JavaScript

  1. #1
    Membre à l'essai
    Profil pro
    Inscrit en
    Novembre 2010
    Messages
    50
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Novembre 2010
    Messages : 50
    Points : 17
    Points
    17
    Par défaut Aide pour un code javascript
    Salut à tous,

    j'ai créé une mise en page pour une annonce sur un site de vente aux enchères pour lequel le rendu présentait des problèmes. Après avoir contacté le service client, ce dernier m'a répondu ceci:

    Nous avons trouvé des STYLE Tags et des SCRIPT Tags, qui ne sont pas acceptés par notre système.
    Vous pouvez utiliser le CSS Style mais ce dernier ne peut qu'être utilisé sur le tag ( dans la ligne du texte) concerné.

    Par la suite j'ai réécris tout le code (sans le javascript) et le rendu dans l'annonce et parfait.

    Maintenant, je voudrais lorsque je clique sur une des images du div "C9" que celle-ci apparait dans le div "C8", mais je ne sais pas comment réintroduire cette action dans mon nouveau code.


    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    <script language="javascript">
    function remplace(image) {
    document.getElementById("C8").innerHTML="<img src='"+image+"'>";
    }
    </script>
     
    <img src="http://data.imagup.com/2/1105402426.jpg"
    onclick="remplace('http://data.imagup.com/2/1105402426.jpg');"
    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
    <div
    style="height: 400px; width: 700px; float: left; background-image: url(http://data.imagup.com/2/1105402426.jpg);"
    id="C8">
    </div>
    <div style="text-align: right; width: 80px; float: left;" id="C9"><img
    style="width: 70px; height: 40px;" alt=""
    src="http://data.imagup.com/2/1105402426.jpg"><br>
    <br>
    <img style="width: 70px; height: 40px;" alt=""
    src="http://data.imagup.com/2/1105402426.jpg"><br>
    <br>
    <img style="width: 70px; height: 40px;" alt=""
    src="http://data.imagup.com/2/1105402426.jpg"><br>
    <br>
    <img style="width: 70px; height: 40px;" alt=""
    src="http://data.imagup.com/2/1105402426.jpg"><br>
    </div>

  2. #2
    Membre habitué Avatar de the-destroyer
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2009
    Messages
    204
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 29
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mars 2009
    Messages : 204
    Points : 125
    Points
    125
    Par défaut
    Hello !

    Il faut que tu assigne a toutes tes images un evenement onclick et lorsque n click survient sur une image, ta fonction soit apellé:

    Code javascript : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
    function change(ele){
    document.getElementById("C8").innerHTML = '<img src="' + ele.src + '" alt="X" />';
    }

    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
     
    <div
    style="height: 400px; width: 700px; float: left; background-image: url(http://data.imagup.com/2/1105402426.jpg);"
    id="C8">
    </div>
    <div style="text-align: right; width: 80px; float: left;" id="C9"><img
    style="width: 70px; height: 40px;" alt=""
    src="http://data.imagup.com/2/1105402426.jpg" onclick="change(this);"><br>
    <br>
    <img style="width: 70px; height: 40px;" alt=""
    src="http://data.imagup.com/2/1105402426.jpg" onclick="change(this);"><br>
    <br>
    <img style="width: 70px; height: 40px;" alt=""
    src="http://data.imagup.com/2/1105402426.jpg" onclick="change(this);"><br>
    <br>
    <img style="width: 70px; height: 40px;" alt=""
    src="http://data.imagup.com/2/1105402426.jpg" onclick="change(this);"><br>
    </div>

  3. #3
    Membre à l'essai
    Profil pro
    Inscrit en
    Novembre 2010
    Messages
    50
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Novembre 2010
    Messages : 50
    Points : 17
    Points
    17
    Par défaut
    Ok merci pour ton aide, mais malheureusement je ne sais pas comment les placer dans mon code.

    Le code javascrip je le met ou dans mon code (sachant que je dois le mettre en attribut)?


    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
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    <html>
    <head>
    <meta content="text/html; charset=ISO-8859-1"
    http-equiv="content-type">
    <title>Ricardo</title>
    </head>
    <body>
    <div
    style="width: 780px; margin-right: auto; margin-left: auto; line-height: 13px;"
    id="CP">
    <div style="text-align: center;" id="C1"><img
    style="width: 41px; height: 12px;" alt=""
    src="http://data.imagup.com/2/1105182592.png">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <img style="width: 42px; height: 12px;" alt=""
    src="http://data.imagup.com/3/1105182610.png">
    </div>
    <div style="height: 30px; width: 780px; clear: both;" id="E2">
    </div>
    <div
    style="text-align: center; width: 780px; font-family: Lucida Grande; line-height: 16px;"
    id="C3"><strong style="color: rgb(68, 68, 68);"><span
    style="font-size: 14px;">XXX</span></strong><br>
    <strong style="color: rgb(68, 68, 68);"><span style="font-size: 14px;">XXX</span></strong><br>
    <br>
    <font color="#9900cc"><strong><span style="font-size: 12px;">XXX</span></strong></font>
    </div>
    <div style="height: 40px; width: 780px;" id="E2">
    </div>
    <div style="text-align: center; width: 780px;" id="C4">
    <table style="width: 780px;" border="0" cellpadding="0" cellspacing="0">
    <tbody>
    <tr>
    <td width="100">&nbsp;</td>
    <td id="TC2"
    style="width: 290px; font-family: Century Gothic; font-size: 11px; text-align: left;"><span
    style="font-weight: bold; font-size: 14px; line-height: 16px; color: rgb(68, 68, 68);">XXX</span><br>
    <span
    style="font-weight: bold; font-size: 14px; line-height: 16px; color: rgb(68, 68, 68);">XXX</span><br>
    <br>
    <br>
    <span
    style="line-height: 13px; font-weight: bold; color: rgb(68, 68, 68);">XXX</span><br>
    <br>
    <span
    style="line-height: 13px; font-weight: bold; color: rgb(68, 68, 68);">XXX:</span><br>
    <span style="line-height: 13px; color: rgb(102, 102, 102);">XXX</span><br>
    <span style="line-height: 13px; color: rgb(102, 102, 102);">XXX</span><br>
    <span style="line-height: 13px; color: rgb(102, 102, 102);">XXX</span><br>
    <br>
    <span
    style="line-height: 13px; font-weight: bold; color: rgb(68, 68, 68);">XXX:</span><br>
    <span style="line-height: 13px; color: rgb(102, 102, 102);">XXX</span><br>
    <br>
    <span
    style="line-height: 13px; font-weight: bold; color: rgb(68, 68, 68);">XXX:</span><br>
    <span style="line-height: 13px; color: rgb(102, 102, 102);">XXX</span><br>
    <br>
    <span
    style="line-height: 13px; font-weight: bold; color: rgb(68, 68, 68);">XXX:</span><br>
    <span style="line-height: 13px; color: rgb(102, 102, 102);">XXX</span><br>
    <span style="line-height: 13px; color: rgb(102, 102, 102);">XXX</span><br>
    <br>
    <span
    style="line-height: 13px; font-weight: bold; color: rgb(68, 68, 68);">XXX:</span><br>
    <span style="line-height: 13px; color: rgb(102, 102, 102);">XXX</span><br>
    <br>
    <span
    style="line-height: 13px; font-weight: bold; color: rgb(68, 68, 68);">XXX:</span><br>
    <span style="line-height: 13px; color: rgb(102, 102, 102);">XXX</span>
    </td>
    <td width="0">&nbsp;</td>
    <td style="text-align: center;" width="380"> <br>
    </td>
    </tr>
    </tbody>
    </table>
    </div>
    <div style="height: 40px; width: 780px; clear: both;" id="E3">
    </div>
    <div
    style="border: 1px solid rgb(204, 204, 204); overflow: auto; text-align: justify; height: 250px; width: 780px; font-family: Century Gothic; font-size: 11px;"
    id="C5">
    <strong style="color: rgb(68, 68, 68);">XXX</strong><br>
    <br>
    <span style="color: rgb(102, 102, 102);"> XXX</span><br
    style="color: rgb(102, 102, 102);">
    <br style="color: rgb(102, 102, 102);">
    <span style="color: rgb(102, 102, 102);"> XXX</span><br
    style="color: rgb(102, 102, 102);">
    <br style="color: rgb(102, 102, 102);">
    <span style="color: rgb(102, 102, 102);"> XXX</span><br
    style="color: rgb(102, 102, 102);">
    <br style="color: rgb(102, 102, 102);">
    <span style="color: rgb(102, 102, 102);"> XXX</span><br>
    <br>
    <br>
    <strong style="color: rgb(68, 68, 68);">XXX</strong><br>
    <br>
    <span style="color: rgb(102, 102, 102);"> XXX</span><br
    style="color: rgb(102, 102, 102);">
    <br style="color: rgb(102, 102, 102);">
    <span style="color: rgb(102, 102, 102);"> XXX</span><br
    style="color: rgb(102, 102, 102);">
    <br style="color: rgb(102, 102, 102);">
    <span style="color: rgb(102, 102, 102);"> XXX</span><br
    style="color: rgb(102, 102, 102);">
    <br style="color: rgb(102, 102, 102);">
    <span style="color: rgb(102, 102, 102);"> XXX</span>
    </div>
    <div style="height: 30px; width: 780px;" id="E4">
    </div>
    <div
    style="text-align: center; width: 700px; float: left; font-family: Century Gothic; font-size: 11px;"
    id="C6">
    <p><a style="text-decoration: none;" href="XXX" target="_blank">XXX</a><br>
    </p>
    </div>
    <div style="width: 80px; float: left;" id="C7">
    </div>
    <div
    style="height: 400px; width: 700px; float: left; background-image: url(http://data.imagup.com/2/1105402426.jpg);"
    id="C8">
    </div>
    <div style="text-align: right; width: 80px; float: left;" id="C9"><img
    style="width: 70px; height: 40px;" alt=""
    src="http://data.imagup.com/2/1105402426.jpg" onclick="change(this);"><br>
    <br>
    <img style="width: 70px; height: 40px;" alt=""
    src="http://data.imagup.com/2/1105402426.jpg" onclick="change(this);"><br>
    <br>
    <img style="width: 70px; height: 40px;" alt=""
    src="http://data.imagup.com/2/1105402426.jpg" onclick="change(this);"><br>
    <br>
    <img style="width: 70px; height: 40px;" alt=""
    src="http://data.imagup.com/2/1105402426.jpg" onclick="change(this);"><br>
    </div>
    <div
    style="text-align: center; height: 30px; width: 780px; clear: both;"
    id="E5">
    </div>
    <div
    style="text-align: center; width: 780px; font-family: Lucida Grande; line-height: 16px;"
    id="C10">
    <strong style="color: rgb(68, 68, 68);"><span style="font-size: 10px;">XXX</span>
    </strong></div>
    </div>
    </body>
    </html>

  4. #4
    Membre habitué Avatar de the-destroyer
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2009
    Messages
    204
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 29
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mars 2009
    Messages : 204
    Points : 125
    Points
    125
    Par défaut
    Si j'ai bien compris ton problème: pour les balises javascript il est autorisé de les mettres dans le body mais pas conseiller, il te faut les mettre dans le <head> et les actions a exécuter tu peu les mettre dans les balises html
    comme ceci:

    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
    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
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
     
    <html>
    <head>
    <meta content="text/html; charset=ISO-8859-1"
    http-equiv="content-type">
    <title>Ricardo</title>
    <script language="javascript" >
    // Mon code javascript trop bien pour toute ma page :D
    function a() {
    alert('Ca marche, c'est trop bien ! :D');
    }
    </script>
    </head>
    <body onload="a();">
    <div style="width: 780px; margin-right: auto; margin-left: auto; line-height: 13px;"
    id="CP">
    <div style="text-align: center;" id="C1"><img
    style="width: 41px; height: 12px;" alt=""
    src="http://data.imagup.com/2/1105182592.png">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <img style="width: 42px; height: 12px;" alt=""
    src="http://data.imagup.com/3/1105182610.png">
    </div>
    <div style="height: 30px; width: 780px; clear: both;" id="E2">
    </div>
    <div
    style="text-align: center; width: 780px; font-family: Lucida Grande; line-height: 16px;"
    id="C3"><strong style="color: rgb(68, 68, 68);"><span
    style="font-size: 14px;">XXX</span></strong><br>
    <strong style="color: rgb(68, 68, 68);"><span style="font-size: 14px;">XXX</span></strong><br>
    <br>
    <font color="#9900cc"><strong><span style="font-size: 12px;">XXX</span></strong></font>
    </div>
    <div style="height: 40px; width: 780px;" id="E2">
    </div>
    <div style="text-align: center; width: 780px;" id="C4">
    <table style="width: 780px;" border="0" cellpadding="0" cellspacing="0">
    <tbody>
    <tr>
    <td width="100">&nbsp;</td>
    <td id="TC2"
    style="width: 290px; font-family: Century Gothic; font-size: 11px; text-align: left;"><span
    style="font-weight: bold; font-size: 14px; line-height: 16px; color: rgb(68, 68, 68);">XXX</span><br>
    <span
    style="font-weight: bold; font-size: 14px; line-height: 16px; color: rgb(68, 68, 68);">XXX</span><br>
    <br>
    <br>
    <span
    style="line-height: 13px; font-weight: bold; color: rgb(68, 68, 68);">XXX</span><br>
    <br>
    <span
    style="line-height: 13px; font-weight: bold; color: rgb(68, 68, 68);">XXX:</span><br>
    <span style="line-height: 13px; color: rgb(102, 102, 102);">XXX</span><br>
    <span style="line-height: 13px; color: rgb(102, 102, 102);">XXX</span><br>
    <span style="line-height: 13px; color: rgb(102, 102, 102);">XXX</span><br>
    <br>
    <span
    style="line-height: 13px; font-weight: bold; color: rgb(68, 68, 68);">XXX:</span><br>
    <span style="line-height: 13px; color: rgb(102, 102, 102);">XXX</span><br>
    <br>
    <span
    style="line-height: 13px; font-weight: bold; color: rgb(68, 68, 68);">XXX:</span><br>
    <span style="line-height: 13px; color: rgb(102, 102, 102);">XXX</span><br>
    <br>
    <span
    style="line-height: 13px; font-weight: bold; color: rgb(68, 68, 68);">XXX:</span><br>
    <span style="line-height: 13px; color: rgb(102, 102, 102);">XXX</span><br>
    <span style="line-height: 13px; color: rgb(102, 102, 102);">XXX</span><br>
    <br>
    <span
    style="line-height: 13px; font-weight: bold; color: rgb(68, 68, 68);">XXX:</span><br>
    <span style="line-height: 13px; color: rgb(102, 102, 102);">XXX</span><br>
    <br>
    <span
    style="line-height: 13px; font-weight: bold; color: rgb(68, 68, 68);">XXX:</span><br>
    <span style="line-height: 13px; color: rgb(102, 102, 102);">XXX</span>
    </td>
    <td width="0">&nbsp;</td>
    <td style="text-align: center;" width="380"> <br>
    </td>
    </tr>
    </tbody>
    </table>
    </div>
    <div style="height: 40px; width: 780px; clear: both;" id="E3">
    </div>
    <div
    style="border: 1px solid rgb(204, 204, 204); overflow: auto; text-align: justify; height: 250px; width: 780px; font-family: Century Gothic; font-size: 11px;"
    id="C5">
    <strong style="color: rgb(68, 68, 68);">XXX</strong><br>
    <br>
    <span style="color: rgb(102, 102, 102);"> XXX</span><br
    style="color: rgb(102, 102, 102);">
    <br style="color: rgb(102, 102, 102);">
    <span style="color: rgb(102, 102, 102);"> XXX</span><br
    style="color: rgb(102, 102, 102);">
    <br style="color: rgb(102, 102, 102);">
    <span style="color: rgb(102, 102, 102);"> XXX</span><br
    style="color: rgb(102, 102, 102);">
    <br style="color: rgb(102, 102, 102);">
    <span style="color: rgb(102, 102, 102);"> XXX</span><br>
    <br>
    <br>
    <strong style="color: rgb(68, 68, 68);">XXX</strong><br>
    <br>
    <span style="color: rgb(102, 102, 102);"> XXX</span><br
    style="color: rgb(102, 102, 102);">
    <br style="color: rgb(102, 102, 102);">
    <span style="color: rgb(102, 102, 102);"> XXX</span><br
    style="color: rgb(102, 102, 102);">
    <br style="color: rgb(102, 102, 102);">
    <span style="color: rgb(102, 102, 102);"> XXX</span><br
    style="color: rgb(102, 102, 102);">
    <br style="color: rgb(102, 102, 102);">
    <span style="color: rgb(102, 102, 102);"> XXX</span>
    </div>
    <div style="height: 30px; width: 780px;" id="E4">
    </div>
    <div
    style="text-align: center; width: 700px; float: left; font-family: Century Gothic; font-size: 11px;"
    id="C6">
    <p><a style="text-decoration: none;" href="XXX" target="_blank">XXX</a><br>
    </p>
    </div>
    <div style="width: 80px; float: left;" id="C7">
    </div>
    <div
    style="height: 400px; width: 700px; float: left; background-image: url(http://data.imagup.com/2/1105402426.jpg);"
    id="C8">
    </div>
    <div style="text-align: right; width: 80px; float: left;" id="C9"><img
    style="width: 70px; height: 40px;" alt=""
    src="http://data.imagup.com/2/1105402426.jpg" onclick="change(this);"><br>
    <br>
    <img style="width: 70px; height: 40px;" alt=""
    src="http://data.imagup.com/2/1105402426.jpg" onclick="change(this);"><br>
    <br>
    <img style="width: 70px; height: 40px;" alt=""
    src="http://data.imagup.com/2/1105402426.jpg" onclick="change(this);"><br>
    <br>
    <img style="width: 70px; height: 40px;" alt=""
    src="http://data.imagup.com/2/1105402426.jpg" onclick="change(this);"><br>
    </div>
    <div
    style="text-align: center; height: 30px; width: 780px; clear: both;"
    id="E5">
    </div>
    <div
    style="text-align: center; width: 780px; font-family: Lucida Grande; line-height: 16px;"
    id="C10">
    <strong style="color: rgb(68, 68, 68);"><span style="font-size: 10px;">XXX</span>
    </strong></div>
    </div>
    </body>
    </html>

    Cela répond-t-il a ton problème ?

  5. #5
    Membre à l'essai
    Profil pro
    Inscrit en
    Novembre 2010
    Messages
    50
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Novembre 2010
    Messages : 50
    Points : 17
    Points
    17
    Par défaut
    Tout d'abord un grand merci pour ton aide, car je suis complètement perdu avec cette manière de faire, mais visiblement le code ne fonctionne pas.

    J'obtiens le résultat suivant: http://www.imagup.com/data/1105615700.html

    Donc est-il possible et comment le mettre directement dans le body?

  6. #6
    Membre habitué Avatar de the-destroyer
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2009
    Messages
    204
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 29
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mars 2009
    Messages : 204
    Points : 125
    Points
    125
    Par défaut
    Wow jamais vu ca O_O

    ca donnerait un truc comme ca:
    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
    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
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    <html>
    <head>
    <meta content="text/html; charset=ISO-8859-1"
    http-equiv="content-type">
    <title>Ricardo</title>
    </head>
    <body onload="a();">
    <script language="javascript" >
    // Mon code javascript trop bien pour toute ma page :D
    function a() {
    alert('Ca marche, c'est trop bien ! :D');
    }
    </script>
    <div style="width: 780px; margin-right: auto; margin-left: auto; line-height: 13px;"
    id="CP">
    <div style="text-align: center;" id="C1"><img
    style="width: 41px; height: 12px;" alt=""
    src="http://data.imagup.com/2/1105182592.png">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <img style="width: 42px; height: 12px;" alt=""
    src="http://data.imagup.com/3/1105182610.png">
    </div>
    <div style="height: 30px; width: 780px; clear: both;" id="E2">
    </div>
    <div
    style="text-align: center; width: 780px; font-family: Lucida Grande; line-height: 16px;"
    id="C3"><strong style="color: rgb(68, 68, 68);"><span
    style="font-size: 14px;">XXX</span></strong><br>
    <strong style="color: rgb(68, 68, 68);"><span style="font-size: 14px;">XXX</span></strong><br>
    <br>
    <font color="#9900cc"><strong><span style="font-size: 12px;">XXX</span></strong></font>
    </div>
    <div style="height: 40px; width: 780px;" id="E2">
    </div>
    <div style="text-align: center; width: 780px;" id="C4">
    <table style="width: 780px;" border="0" cellpadding="0" cellspacing="0">
    <tbody>
    <tr>
    <td width="100">&nbsp;</td>
    <td id="TC2"
    style="width: 290px; font-family: Century Gothic; font-size: 11px; text-align: left;"><span
    style="font-weight: bold; font-size: 14px; line-height: 16px; color: rgb(68, 68, 68);">XXX</span><br>
    <span
    style="font-weight: bold; font-size: 14px; line-height: 16px; color: rgb(68, 68, 68);">XXX</span><br>
    <br>
    <br>
    <span
    style="line-height: 13px; font-weight: bold; color: rgb(68, 68, 68);">XXX</span><br>
    <br>
    <span
    style="line-height: 13px; font-weight: bold; color: rgb(68, 68, 68);">XXX:</span><br>
    <span style="line-height: 13px; color: rgb(102, 102, 102);">XXX</span><br>
    <span style="line-height: 13px; color: rgb(102, 102, 102);">XXX</span><br>
    <span style="line-height: 13px; color: rgb(102, 102, 102);">XXX</span><br>
    <br>
    <span
    style="line-height: 13px; font-weight: bold; color: rgb(68, 68, 68);">XXX:</span><br>
    <span style="line-height: 13px; color: rgb(102, 102, 102);">XXX</span><br>
    <br>
    <span
    style="line-height: 13px; font-weight: bold; color: rgb(68, 68, 68);">XXX:</span><br>
    <span style="line-height: 13px; color: rgb(102, 102, 102);">XXX</span><br>
    <br>
    <span
    style="line-height: 13px; font-weight: bold; color: rgb(68, 68, 68);">XXX:</span><br>
    <span style="line-height: 13px; color: rgb(102, 102, 102);">XXX</span><br>
    <span style="line-height: 13px; color: rgb(102, 102, 102);">XXX</span><br>
    <br>
    <span
    style="line-height: 13px; font-weight: bold; color: rgb(68, 68, 68);">XXX:</span><br>
    <span style="line-height: 13px; color: rgb(102, 102, 102);">XXX</span><br>
    <br>
    <span
    style="line-height: 13px; font-weight: bold; color: rgb(68, 68, 68);">XXX:</span><br>
    <span style="line-height: 13px; color: rgb(102, 102, 102);">XXX</span>
    </td>
    <td width="0">&nbsp;</td>
    <td style="text-align: center;" width="380"> <br>
    </td>
    </tr>
    </tbody>
    </table>
    </div>
    <div style="height: 40px; width: 780px; clear: both;" id="E3">
    </div>
    <div
    style="border: 1px solid rgb(204, 204, 204); overflow: auto; text-align: justify; height: 250px; width: 780px; font-family: Century Gothic; font-size: 11px;"
    id="C5">
    <strong style="color: rgb(68, 68, 68);">XXX</strong><br>
    <br>
    <span style="color: rgb(102, 102, 102);"> XXX</span><br
    style="color: rgb(102, 102, 102);">
    <br style="color: rgb(102, 102, 102);">
    <span style="color: rgb(102, 102, 102);"> XXX</span><br
    style="color: rgb(102, 102, 102);">
    <br style="color: rgb(102, 102, 102);">
    <span style="color: rgb(102, 102, 102);"> XXX</span><br
    style="color: rgb(102, 102, 102);">
    <br style="color: rgb(102, 102, 102);">
    <span style="color: rgb(102, 102, 102);"> XXX</span><br>
    <br>
    <br>
    <strong style="color: rgb(68, 68, 68);">XXX</strong><br>
    <br>
    <span style="color: rgb(102, 102, 102);"> XXX</span><br
    style="color: rgb(102, 102, 102);">
    <br style="color: rgb(102, 102, 102);">
    <span style="color: rgb(102, 102, 102);"> XXX</span><br
    style="color: rgb(102, 102, 102);">
    <br style="color: rgb(102, 102, 102);">
    <span style="color: rgb(102, 102, 102);"> XXX</span><br
    style="color: rgb(102, 102, 102);">
    <br style="color: rgb(102, 102, 102);">
    <span style="color: rgb(102, 102, 102);"> XXX</span>
    </div>
    <div style="height: 30px; width: 780px;" id="E4">
    </div>
    <div
    style="text-align: center; width: 700px; float: left; font-family: Century Gothic; font-size: 11px;"
    id="C6">
    <p><a style="text-decoration: none;" href="XXX" target="_blank">XXX</a><br>
    </p>
    </div>
    <div style="width: 80px; float: left;" id="C7">
    </div>
    <div
    style="height: 400px; width: 700px; float: left; background-image: url(http://data.imagup.com/2/1105402426.jpg);"
    id="C8">
    </div>
    <div style="text-align: right; width: 80px; float: left;" id="C9"><img
    style="width: 70px; height: 40px;" alt=""
    src="http://data.imagup.com/2/1105402426.jpg" onclick="change(this);"><br>
    <br>
    <img style="width: 70px; height: 40px;" alt=""
    src="http://data.imagup.com/2/1105402426.jpg" onclick="change(this);"><br>
    <br>
    <img style="width: 70px; height: 40px;" alt=""
    src="http://data.imagup.com/2/1105402426.jpg" onclick="change(this);"><br>
    <br>
    <img style="width: 70px; height: 40px;" alt=""
    src="http://data.imagup.com/2/1105402426.jpg" onclick="change(this);"><br>
    </div>
    <div
    style="text-align: center; height: 30px; width: 780px; clear: both;"
    id="E5">
    </div>
    <div
    style="text-align: center; width: 780px; font-family: Lucida Grande; line-height: 16px;"
    id="C10">
    <strong style="color: rgb(68, 68, 68);"><span style="font-size: 10px;">XXX</span>
    </strong></div>
    </div>
    </body>
    </html>

    Ca donne comment de cette facon ?

  7. #7
    Membre à l'essai
    Profil pro
    Inscrit en
    Novembre 2010
    Messages
    50
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Novembre 2010
    Messages : 50
    Points : 17
    Points
    17
    Par défaut
    Bin malheureusement ça donne le même résultat.

    Donc dernière solution je sais pas s'il est possible d'implanter la fonction directement sur la ligne du div?

    Ou s'il est possible de faire ça avec autre que du javascript?

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    <div style="height: 400px; width: 700px; float: left; background-image: url(http://data.imagup.com/2/1105402426.jpg);"
    id="C8">

  8. #8
    Membre habitué Avatar de the-destroyer
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2009
    Messages
    204
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 29
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mars 2009
    Messages : 204
    Points : 125
    Points
    125
    Par défaut
    D'accord alors si tu met tout ca sur une ligne ca ne marchera pas puis bonjour toues les lignes, tu vas vite t'embrouiller X_X
    Vérifie les options sur le javascript de ton navigateur sinon il est possible que cela vienne de ton serveur mais je ne m'y connait pas assez pour t'aider sur ce domaine. Le problème c'est que ton javascript n'est pas interpréter

    Tu peu essayer de faire tout cela en flash mais bon il te faudra réapprendre un langage...

    Désolé je ne vois plus pourquoi cela ne marche pas si cela ne vient pas de tes options javascript de ton navigateur...

  9. #9
    Membre à l'essai
    Profil pro
    Inscrit en
    Novembre 2010
    Messages
    50
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Novembre 2010
    Messages : 50
    Points : 17
    Points
    17
    Par défaut
    bin en faite lorsque j'ouvre mon fichier html et que je vois son rendu et son fonctionnement avec safari ou firefox tout est ok!

    Mais le problème c'est quand je récupère le code pour le placer dans mon annonce, cela ne fonctionne pas (le rendu et bon mais le changement d'image ne fonctionne pas!

    Et c'est en fonction de ce que m'a répondu le service client (que le javascript été accepté) que je me demande comment (sous certaine condition ci-dessous) comment faire pour l'implanter dans mon code?

    "Nous avons trouvé des STYLE Tags et des SCRIPT Tags, qui ne sont pas acceptés par notre système.
    Vous pouvez utiliser le CSS Style mais ce dernier ne peut qu'être utilisé sur le tag ( dans la ligne du texte) concerné."

  10. #10
    Membre habitué Avatar de the-destroyer
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2009
    Messages
    204
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 29
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Mars 2009
    Messages : 204
    Points : 125
    Points
    125
    Par défaut
    Alors la j'en ai aucune idée désolé :s

    Il faudrait que tu demandes au service qui gère ton annonce (service client surement)

  11. #11
    Membre averti Avatar de SPACHFR
    Profil pro
    Paaaaaa
    Inscrit en
    Février 2004
    Messages
    557
    Détails du profil
    Informations personnelles :
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Paaaaaa

    Informations forums :
    Inscription : Février 2004
    Messages : 557
    Points : 400
    Points
    400
    Par défaut
    Bonjour,

    Je pense que tu dois obligatoirement déclarer tes éléments de style (CSS) dans la balise de style. et tes fonctions javascript dans la balise <script> mais pas dans le corps(body)

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
     
    <html>
    <head>
    <style>
    /* ici tes class CSS */
    </style>
    <script>
    /* ici tes fonctions javascript */
    </script>
    </head>
    <body>
    /* ici le contenu de ta page */
    </body>
    </html>
    S'il n'y a pas de solution c'est qu'il n'y a pas de problème.

  12. #12
    Rédacteur

    Avatar de Bovino
    Homme Profil pro
    Développeur Web
    Inscrit en
    Juin 2008
    Messages
    23 647
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 53
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juin 2008
    Messages : 23 647
    Points : 91 220
    Points
    91 220
    Billets dans le blog
    20
    Par défaut
    Non, je pense plutôt qu'il n'est pas possible d'ajouter du code JavaScript dans cette interface.
    Ce qui serait assez logique pour des raisons de sécurité.
    Pas de question technique par MP !
    Tout le monde peut participer à developpez.com, vous avez une idée, contactez-moi !
    Mes formations video2brain : La formation complète sur JavaScriptJavaScript et le DOM par la pratiquePHP 5 et MySQL : les fondamentaux
    Mon livre sur jQuery
    Module Firefox / Chrome d'intégration de JSFiddle et CodePen sur le forum

Discussions similaires

  1. Petite aide pour mon code javascript
    Par bennji dans le forum Général JavaScript
    Réponses: 1
    Dernier message: 27/12/2008, 19h42
  2. aide pour un code
    Par foulla002 dans le forum Langage
    Réponses: 7
    Dernier message: 18/07/2006, 11h04
  3. Demande d'aide pour un menu javascript
    Par Lost-H dans le forum Général JavaScript
    Réponses: 2
    Dernier message: 21/06/2006, 16h17
  4. aide pour du code svp
    Par rootsngaia dans le forum Général JavaScript
    Réponses: 2
    Dernier message: 12/04/2006, 23h40
  5. aide pour un script javascript
    Par speedylol dans le forum Général JavaScript
    Réponses: 9
    Dernier message: 22/03/2006, 14h28

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