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 averti
    Profil pro
    Inscrit en
    Novembre 2010
    Messages
    50
    D�tails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Novembre 2010
    Messages : 50
    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 confirm� Avatar de the-destroyer
    Homme Profil pro
    �tudiant
    Inscrit en
    Mars 2009
    Messages
    204
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    �ge : 30
    Localisation : France, Paris (�le de France)

    Informations professionnelles :
    Activit� : �tudiant

    Informations forums :
    Inscription : Mars 2009
    Messages : 204
    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 averti
    Profil pro
    Inscrit en
    Novembre 2010
    Messages
    50
    D�tails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Novembre 2010
    Messages : 50
    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 confirm� Avatar de the-destroyer
    Homme Profil pro
    �tudiant
    Inscrit en
    Mars 2009
    Messages
    204
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    �ge : 30
    Localisation : France, Paris (�le de France)

    Informations professionnelles :
    Activit� : �tudiant

    Informations forums :
    Inscription : Mars 2009
    Messages : 204
    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 averti
    Profil pro
    Inscrit en
    Novembre 2010
    Messages
    50
    D�tails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Novembre 2010
    Messages : 50
    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 confirm� Avatar de the-destroyer
    Homme Profil pro
    �tudiant
    Inscrit en
    Mars 2009
    Messages
    204
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    �ge : 30
    Localisation : France, Paris (�le de France)

    Informations professionnelles :
    Activit� : �tudiant

    Informations forums :
    Inscription : Mars 2009
    Messages : 204
    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 averti
    Profil pro
    Inscrit en
    Novembre 2010
    Messages
    50
    D�tails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Novembre 2010
    Messages : 50
    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 confirm� Avatar de the-destroyer
    Homme Profil pro
    �tudiant
    Inscrit en
    Mars 2009
    Messages
    204
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    �ge : 30
    Localisation : France, Paris (�le de France)

    Informations professionnelles :
    Activit� : �tudiant

    Informations forums :
    Inscription : Mars 2009
    Messages : 204
    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 averti
    Profil pro
    Inscrit en
    Novembre 2010
    Messages
    50
    D�tails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Novembre 2010
    Messages : 50
    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 confirm� Avatar de the-destroyer
    Homme Profil pro
    �tudiant
    Inscrit en
    Mars 2009
    Messages
    204
    D�tails du profil
    Informations personnelles :
    Sexe : Homme
    �ge : 30
    Localisation : France, Paris (�le de France)

    Informations professionnelles :
    Activit� : �tudiant

    Informations forums :
    Inscription : Mars 2009
    Messages : 204
    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 �clair� 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
    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>

  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 : 55
    Localisation : France, Gironde (Aquitaine)

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

    Informations forums :
    Inscription : Juin 2008
    Messages : 23 647
    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