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 :

Message d'erreur dans barre statu IE


Sujet :

JavaScript

  1. #1
    Membre averti Avatar de BRUNO71
    Homme Profil pro
    Retraité
    Inscrit en
    Janvier 2007
    Messages
    504
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 62
    Localisation : France, Saône et Loire (Bourgogne)

    Informations professionnelles :
    Activité : Retraité
    Secteur : Industrie

    Informations forums :
    Inscription : Janvier 2007
    Messages : 504
    Points : 320
    Points
    320
    Par défaut Message d'erreur dans barre statu IE
    Bonjour,

    Je ne sais pas si je suis sur le bon forum !
    Voilà, j'ai réalisé un site dont une page avec des photos, mais lorsque celle-ci s'ouvre un message d'erreur apparaît dans IE en bas à gauche..
    ( Erreur sur la page ).
    Ligne 209
    Caractère 2

    Comment trouver cette erreur ?

    Voici le code de la page :
    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
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
    <head>
     
      <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
      <title>Photos</title>
     
     
      <link href="style2.css" media="screen" rel="stylesheet" title="CSS" type="text/css" />
     
      <link href="lightbox.css" rel="stylesheet" type="text/css" />
     
      <script type="text/javascript" src="lightbox.js"></script>
    </head>
     
     
    <body oncontextmenu="return false;" ondragstart="return false;" onselectstart="return false;">
     
    <div id="container">
    <div id="masthead">
    <h1>Les photos</h1>
     
    </div>
     
    <div id="navigation">
    <ul>
     
      <li><a href="../index.html">Accueil</a></li>
     
      <li><a href="../produit/produit.html">Nos produits</a></li>
     
      <li><a href="../contact/contact.html">Contact</a></li>
     
    </ul>
     
    </div>
     
    <div id="content_container">
    <div id="column_left" style="width: 596px; height: 365px;"><br />
     
    <div style="text-align: center;">
    <a onclick="window.open(this.href,'_blank');return false;" href="charollaise2.jpg" rel="lightbox" title="Bovin de race Charollais"><img style="width: 98px; height: 148px;" src="charollaise.jpg" class="img_mini" /></a><a onclick="window.open(this.href,'_blank');return false;" href="jersey2.jpg" rel="lightbox" title="Bovin de race Jersey"><img src="jersey.jpg" class="img_mini" /></a><a onclick="window.open(this.href,'_blank');return false;" href="limousine2.jpg" rel="lightbox" title="Bovin de race Limousine"><img src="limousine.jpg" class="img_mini" /></a><a onclick="window.open(this.href,'_blank');return false;" href="montbeliarde2.jpg" rel="lightbox" title="Bovin de race Montb&eacute;liarde"><img src="montbeliarde.jpg" class="img_mini" /></a><a onclick="window.open(this.href,'_blank');return false;" href="normande2.jpg" rel="lightbox" title="Bovin de race Normande"><img src="normande.jpg" class="img_mini" /></a></div>
     
    </div>
     
    <div id="footer">
    <div id="copyright">
    <p><a class="preview" src="charolaise.jpg">Copyright
    thp � 2009. Tous droits
    r&eacute;serv&eacute;s.</a></p>
     
    </div>
     
    <br />
     
    <br />
     
    </div>
     
    </div>
     
    </div>
     
    </body>
    </html>
    Comment faire pour éviter ce message, qui ne fait pas très propre

    Bien cordialement

  2. #2
    Expert éminent sénior

    Avatar de vermine
    Profil pro
    Inscrit en
    Mars 2008
    Messages
    6 582
    Détails du profil
    Informations personnelles :
    Âge : 39
    Localisation : Belgique

    Informations forums :
    Inscription : Mars 2008
    Messages : 6 582
    Points : 79 915
    Points
    79 915
    Par défaut
    La "Ligne 209" précisée par le message d'erreur indique l'instruction (parfois à une ligne près) qui pose problème.

    Ouvrez le code source de la page qui affiche cette erreur (celà dépend de votre navigateur web mais c'est générallement trouvable par un clic droit sur la page puis qqch du genre "code source").
    Quand le code source est ouvert, aller à la ligne 209 (Edition -> Atteindre ou bien Ctrl+G en raccourci). Et recopier nous cette ligne avec son contexte (quelques lignes avant, quelques lignes après).

    Si vous ne trouvez pas de ligne 209 ou bien qu'elle ne mène nulle part, alors cherchez la ligne 209 du fichier source que vous avez créé (si vous séparez vos codes javascript dans des fichiers différents du .html, c'est surement dans ceux là qu'il faut regarder -> lightbox.js si je lis bien le source que vous avez donné).

  3. #3
    Membre averti Avatar de BRUNO71
    Homme Profil pro
    Retraité
    Inscrit en
    Janvier 2007
    Messages
    504
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 62
    Localisation : France, Saône et Loire (Bourgogne)

    Informations professionnelles :
    Activité : Retraité
    Secteur : Industrie

    Informations forums :
    Inscription : Janvier 2007
    Messages : 504
    Points : 320
    Points
    320
    Par défaut
    Bonjour,

    Merci pour cette réponse rapide..
    Effectivement j'ai bien ce fichier, dont voici le code..
    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
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
     
    var loadingImage = 'loading.gif'; var closeButton = 'close.gif';
    function getPageScroll(){
    var yScroll;
    if (self.pageYOffset) {
    yScroll = self.pageYOffset;
    } else if (document.documentElement &amp;&amp;
    document.documentElement.scrollTop){ // Explorer 6 Strict
    yScroll = document.documentElement.scrollTop;
    } else if (document.body) {// all other Explorers
    yScroll = document.body.scrollTop;
    }
    arrayPageScroll = new Array('',yScroll) return arrayPageScroll;
    }
    function getPageSize(){
    var xScroll, yScroll;
    if (window.innerHeight &amp;&amp; window.scrollMaxY) { xScroll
    = document.body.scrollWidth;
    yScroll = window.innerHeight + window.scrollMaxY;
    } else if (document.body.scrollHeight &gt;
    document.body.offsetHeight){ // all but Explorer Mac
    xScroll = document.body.scrollWidth;
    yScroll = document.body.scrollHeight;
    } else { // Explorer Mac...would also work in Explorer 6 Strict,
    Mozilla and Safari
    xScroll = document.body.offsetWidth;
    yScroll = document.body.offsetHeight;
    }
    var windowWidth, windowHeight;
    if (self.innerHeight) { // all except Explorer
    windowWidth = self.innerWidth;
    windowHeight = self.innerHeight;
    } else if (document.documentElement &amp;&amp;
    document.documentElement.clientHeight) { // Explorer 6 Strict Mode
    windowWidth = document.documentElement.clientWidth;
    windowHeight = document.documentElement.clientHeight;
    } else if (document.body) { // other Explorers
    windowWidth = document.body.clientWidth;
    windowHeight = document.body.clientHeight;
    } // for small pages with total height less then height of the viewport
    if(yScroll &lt; windowHeight){
    pageHeight = windowHeight;
    } else { pageHeight = yScroll;
    }
    // for small pages with total width less then width of the viewport
    if(xScroll &lt; windowWidth){ pageWidth = windowWidth;
    } else {
    pageWidth = xScroll;
    }
    arrayPageSize = new
    Array(pageWidth,pageHeight,windowWidth,windowHeight) return
    arrayPageSize;
    }
    function pause(numberMillis) {
    var now = new Date();
    var exitTime = now.getTime() + numberMillis;
    while (true) {
    now = new Date();
    if (now.getTime() &gt; exitTime)
    return;
    }
    }
    function getKey(e){
    if (e == null) { // ie
    keycode = event.keyCode;
    } else { // mozilla
    keycode = e.which;
    }
    key = String.fromCharCode(keycode).toLowerCase();
    if(key == 'x'){ hideLightbox(); }
    }
    function listenKey () { document.onkeypress = getKey; }
    function showLightbox(objLink)
    {
    var objOverlay = document.getElementById('overlay');
    var objLightbox = document.getElementById('lightbox');
    var objCaption = document.getElementById('lightboxCaption');
    var objImage = document.getElementById('lightboxImage');
    var objLoadingImage = document.getElementById('loadingImage');
    var objLightboxDetails = document.getElementById('lightboxDetails');
    var arrayPageSize = getPageSize();
    var arrayPageScroll = getPageScroll();
    if (objLoadingImage) {
    objLoadingImage.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] -
    35 - objLoadingImage.height) / 2) + 'px');
    objLoadingImage.style.left = (((arrayPageSize[0] - 20 -
    objLoadingImage.width) / 2) + 'px');
    objLoadingImage.style.display = 'block';
    }
    // set height of Overlay to take up whole page and show
    objOverlay.style.height = (arrayPageSize[1] + 'px');
    objOverlay.style.display = 'block';
    // preload image
    imgPreload = new Image();
    imgPreload.onload=function(){
    objImage.src = objLink.href;
    // center lightbox and make sure that the top and left values are not
    negative
    // and the image placed outside the viewport
    var lightboxTop = arrayPageScroll[1] + ((arrayPageSize[3] - 35 -
    imgPreload.height) / 2);
    var lightboxLeft = ((arrayPageSize[0] - 20 - imgPreload.width) / 2);
    objLightbox.style.top = (lightboxTop &lt; 0) ? "0px" : lightboxTop
    + "px";
    objLightbox.style.left = (lightboxLeft &lt; 0) ? "0px" :
    lightboxLeft + "px";
    objLightboxDetails.style.width = imgPreload.width + 'px';
    if(objLink.getAttribute('title')){
    objCaption.style.display = 'block';
    //objCaption.style.width = imgPreload.width + 'px';
    objCaption.innerHTML = objLink.getAttribute('title');
    } else {
    objCaption.style.display = 'none';
    }
    if (navigator.appVersion.indexOf("MSIE")!=-1){
    pause(250);
    } if (objLoadingImage) { objLoadingImage.style.display = 'none'; }
    // Hide select boxes as they will 'peek' through the image in IE
    selects = document.getElementsByTagName("select");
    for (i = 0; i != selects.length; i++) {
    selects[i].style.visibility = "hidden";
    }
    objLightbox.style.display = 'block';
    arrayPageSize = getPageSize();
    objOverlay.style.height = (arrayPageSize[1] + 'px');
    // Check for 'x' keypress
    listenKey();
    return false;
    }
    imgPreload.src = objLink.href;
    }
    //
    // hideLightbox()
    //
    function hideLightbox()
    {
    // get objects
    objOverlay = document.getElementById('overlay');
    objLightbox = document.getElementById('lightbox');
    // hide lightbox and overlay
    objOverlay.style.display = 'none';
    objLightbox.style.display = 'none';
    // make select boxes visible
    selects = document.getElementsByTagName("select");
    for (i = 0; i != selects.length; i++) {
    selects[i].style.visibility = "visible";
    }
    // disable keypress listener
    document.onkeypress = '';
    }
    function initLightbox()
    {
    if (!document.getElementsByTagName){ return; }
    var anchors = document.getElementsByTagName("a");
    // loop through all anchor tags
    for (var i=0; i<anchors.length ;="" i="" var=""
     anchor="anchors[i];" if="" href="" &=""
     (anchor.getattribute="" rel="" ="" lightbox=""
     )="" anchor.onclick="function" (=""
     {showlightbox(this="" return="" false="" }="">
    var objBody = document.getElementsByTagName("body").item(0);
    // create overlay div and hardcode some functional styles (aesthetic
    styles are in CSS file)
    var objOverlay = document.createElement("div");
    objOverlay.setAttribute('id','overlay');
    objOverlay.onclick = function () {hideLightbox(); return false;}
    objOverlay.style.display = 'none';
    objOverlay.style.position = 'absolute';
    objOverlay.style.top = '0';
    objOverlay.style.left = '0';
    objOverlay.style.zIndex = '90';
    objOverlay.style.width = '100%';
    objBody.insertBefore(objOverlay, objBody.firstChild);
    var arrayPageSize = getPageSize();
    var arrayPageScroll = getPageScroll();
    // preload and create loader image
    var imgPreloader = new Image();
    // if loader image found, create link to hide lightbox and create
    loadingimage
    imgPreloader.onload=function(){
    var objLoadingImageLink = document.createElement("a");
    objLoadingImageLink.setAttribute('href','#');
    objLoadingImageLink.onclick = function () {hideLightbox(); return
    false;}
    objOverlay.appendChild(objLoadingImageLink);
    var objLoadingImage = document.createElement("img");
    objLoadingImage.src = loadingImage;
    objLoadingImage.setAttribute('id','loadingImage');
    objLoadingImage.style.position = 'absolute';
    objLoadingImage.style.zIndex = '150';
    objLoadingImageLink.appendChild(objLoadingImage);
    imgPreloader.onload=function(){}; // clear onLoad, as IE will flip out
    w/animated gifs
    return false;
    }
    imgPreloader.src = loadingImage;
    // create lightbox div, same note about styles as above
    var objLightbox = document.createElement("div");
    objLightbox.setAttribute('id','lightbox');
    objLightbox.style.display = 'none';
    objLightbox.style.position = 'absolute';
    objLightbox.style.zIndex = '100'; objBody.insertBefore(objLightbox,
    objOverlay.nextSibling);
    // create link
    var objLink = document.createElement("a");
    objLink.setAttribute('href','#');
    objLink.setAttribute('title','Cliquez pour fermer');
    objLink.onclick = function () {hideLightbox(); return false;}
    objLightbox.appendChild(objLink);
    // preload and create close button image
    var imgPreloadCloseButton = new Image();
    // if close button image found,
    imgPreloadCloseButton.onload=function(){
    var objCloseButton = document.createElement("img");
    objCloseButton.src = closeButton;
    objCloseButton.setAttribute('id','closeButton');
    objCloseButton.style.position = 'absolute';
    objCloseButton.style.zIndex = '200';
    objLink.appendChild(objCloseButton);
    return false;
    }
    imgPreloadCloseButton.src = closeButton;
    // create image
    var objImage = document.createElement("img");
    objImage.setAttribute('id','lightboxImage');
    objLink.appendChild(objImage);
    // create details div, a container for the caption and keyboard message
    var objLightboxDetails = document.createElement("div");
    objLightboxDetails.setAttribute('id','lightboxDetails');
    objLightbox.appendChild(objLightboxDetails);
    // create caption
    var objCaption = document.createElement("div");
    objCaption.setAttribute('id','lightboxCaption');
    objCaption.style.display = 'none';
    objLightboxDetails.appendChild(objCaption);
    // create keyboard message
    var objKeyboardMsg = document.createElement("div");
    objKeyboardMsg.setAttribute('id','keyboardMsg');
    objKeyboardMsg.innerHTML = 'cliquez sur <a href="#"
     onclick="hideLightbox(); return false;"><kbd>x</kbd></a>
    pour fermer';
    objLightboxDetails.appendChild(objKeyboardMsg);
    }
    //
    // addLoadEvent()
    // Adds event to window.onload without overwriting currently assigned
    onload functions.
    function addLoadEvent(func)
    { var oldonload = window.onload;
    if (typeof window.onload != 'function'){
    window.onload = func;
    } else {
    window.onload = function(){
    oldonload();
    func();
    }
    }
    }
    addLoadEvent(initLightbox); // run initLightbox onLoad
    Merci pour l'aide

Discussions similaires

  1. Afficher un message d'erreur dans une fenêtre popup
    Par Quickeno dans le forum Langage
    Réponses: 7
    Dernier message: 08/10/2006, 01h56
  2. Réponses: 4
    Dernier message: 24/08/2006, 10h19
  3. message d'erreur dans sous formulaire
    Par tojiji dans le forum Access
    Réponses: 6
    Dernier message: 28/07/2006, 12h09
  4. Message d'erreur dans phpMyadmin
    Par riadh100 dans le forum SQL Procédural
    Réponses: 1
    Dernier message: 26/09/2005, 14h03
  5. [Tiles]message d'erreur dans un footer (form mal rempli)
    Par clement42 dans le forum Struts 1
    Réponses: 5
    Dernier message: 09/06/2005, 14h51

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