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 :

Probleme avec fonction bloqué


Sujet :

JavaScript

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

    Informations forums :
    Inscription : Janvier 2006
    Messages : 1
    Points : 1
    Points
    1
    Par défaut Probleme avec fonction bloqué
    quand j'ouvre ma page HTML voivi le message d'internet explorer dans une barre jaune en haut:

    Pour vous aider a protéger votre ordinateur, Internet explorer a restreint l'affichage du contenu actif de ce fichier, qui pourrait acceder a votre ordinateur. Cliquez ici pour afficher plus d'option

    voici le code source:
    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
     
    <html>
    <head>
    <title>photos</title>
    <script>
    var text_array = new Array(3); <!-- mettre le nombre de photos -->
     
    text_array[0] = "photo N°0";   <!-- ici les légendes de chaques photos -->
    text_array[1] = "photo N°1";
    text_array[2] = "photo N°2";
    text_array[3] = "photo N°3";
     
     
    function photo(i){
    document.images['img'].src='./jpg/jpg_'+i+'.jpg';
    texte.value =text_array[i] ;
    }
    </script>
    <base target="_self">
    </head>
     
     
    <body bgcolor="#000000">
     
    <center>
    <table>
    <tr><img src="jpg/jpg_0.jpg" name="img" width="450" height="350"></tr>
    </table>
    <table cellpadding=25>
    <td><img src="./gif/gif_0.gif" onclick="photo(0)" width="50" height="50"></td>
    <td><img src="./gif/gif_1.gif" onclick="photo(1)" width="50" height="50"></td>
    <td><img src="./gif/gif_2.gif" onclick="photo(2)" width="50" height="50"></td>
    </table>
    </center>
     
     
    <p align="center"><font face="Verdana" size="2" color="#FFFF00">Cliquez sur les petites photos sur le coté pour les voir en plus grand</font></p>
     
     
     <!-- la plus grande dimension d'un gif doit être de 150 pixels -->
     
    <!-- <center><textarea WRAP="virtual" name="texte" rows=2 cols=66 style="vertical-align: middle; text-align: center; font-family: v; font-size: 10pt; background-color: #009933">
    bla bla bla d'introduction</textarea></center> -->
     
     
    </body>
    </html>

  2. #2
    Modérateur
    Avatar de Bisûnûrs
    Profil pro
    Développeur Web
    Inscrit en
    Janvier 2004
    Messages
    9 868
    Détails du profil
    Informations personnelles :
    Âge : 41
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Janvier 2004
    Messages : 9 868
    Points : 16 258
    Points
    16 258
    Par défaut
    C'est normal avec IE en local.

    Get Firefox

  3. #3
    Rédacteur/Modérateur

    Avatar de SpaceFrog
    Homme Profil pro
    Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Inscrit en
    Mars 2002
    Messages
    39 638
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 74
    Localisation : Royaume-Uni

    Informations professionnelles :
    Activité : Développeur Web Php Mysql Html Javascript CSS Apache - Intégrateur - Bidouilleur SharePoint
    Secteur : Industrie

    Informations forums :
    Inscription : Mars 2002
    Messages : 39 638
    Points : 66 668
    Points
    66 668
    Billets dans le blog
    1
    Par défaut
    Oui et le paramètre de la focntion laisse à désirer ...

    document.images[i]
    ou document.getElementsByTagName('img')[i]
    il faut choisir ...

    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
    <html>
    <head>
    <title>photos</title>
    <script type='text/javascript'>
    var text_array = new Array(); <!-- on s'en fout du nombre ...mettre le nombre de photos -->
     
    text_array[0] = "photo N°0";   <!-- ici les légendes de chaques photos -->
    text_array[1] = "photo N°1";
    text_array[2] = "photo N°2";
    text_array[3] = "photo N°3";
     
     
    function photo(i){
    document.images[i].src='./jpg/jpg_'+i+'.jpg';
    document.getElementsByName('texte')[0].value =text_array[i] ;
    }
    </script>
    <base target="_self">
    </head>
     
     
    <body bgcolor="#000000">
     
    <center>
    <table>
    <tr><img src="jpg/jpg_0.jpg" name="img" width="450" height="350"></tr>
    </table>
    <table cellpadding=25>
    <td><img src="./gif/gif_0.gif" onclick="photo(0)" width="50" height="50"></td>
    <td><img src="./gif/gif_1.gif" onclick="photo(1)" width="50" height="50"></td>
    <td><img src="./gif/gif_2.gif" onclick="photo(2)" width="50" height="50"></td>
    </table>
    </center>
     
     
    <p align="center"><font face="Verdana" size="2" color="#FFFF00">Cliquez sur les petites photos sur le coté pour les voir en plus grand</font></p>
     
     
     <!-- la plus grande dimension d'un gif doit être de 150 pixels -->
     
    <center><textarea WRAP="virtual" name="texte" rows=2 cols=66 style="vertical-align: middle; text-align: center; font-family: v; font-size: 10pt; background-color: #009933">
    bla bla bla d'introduction</textarea></center>
     
     
    </body>
    </html>
    Ma page Developpez - Mon Blog Developpez
    Président du CCMPTP (Comité Contre le Mot "Problème" dans les Titres de Posts)
    Deux règles du succès: 1) Ne communiquez jamais à quelqu'un tout votre savoir...
    Votre post est résolu ? Alors n'oubliez pas le Tag

    Venez sur le Chat de Développez !

Discussions similaires

  1. [Mail] probleme avec fonction mail() !!!
    Par H-bil dans le forum Langage
    Réponses: 6
    Dernier message: 19/06/2006, 23h45
  2. C++ - Probleme avec fonction virtuelle
    Par vdumont dans le forum C++
    Réponses: 1
    Dernier message: 20/03/2006, 20h49
  3. probleme avec fonctions
    Par Burinho dans le forum C
    Réponses: 8
    Dernier message: 29/12/2005, 21h28
  4. Réponses: 17
    Dernier message: 24/03/2005, 12h24
  5. [langage] problème avec fonction read
    Par domidum54 dans le forum Langage
    Réponses: 2
    Dernier message: 30/03/2004, 20h42

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