2013-04-13 15 views
11

Quando accedo alla mia pagina, il titolo viene caricato correttamente, ma dopo un secondo cambia in "In attesa di http://example.com".

Si tratta di un bug di IE o del mio codice? - "Waiting per http://mysite.com"

I pagina viene caricata, ma anche dopo che tutto è stato caricato, il titolo continua, ma solo nella scheda IE, perché nel cassetto il titolo è come dovrebbe essere.

PS: non succede con Chrome. E la versione cioè è 10

Immagine del problema:
enter image description here

Il mio codice HTML:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 
<html> 
    <head> 
     <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
     <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico" /> 

     <title>DataTables Editor example</title> 
     <style class="include" type="text/css"> 
      @import "support/bootstrap/css/bootstrap.css"; 
      @import "support/bootstrap/dataTables/dataTables.bootstrap.css"; 
      @import "css/customTable.css"; 
     </style> 

     <script class="include" type="text/javascript" charset="utf-8" src="../../../media/js/jquery.js"></script> 
     <script class="include" type="text/javascript" charset="utf-8" src="../../../media/js/jquery.dataTables.js"></script> 
     <script class="include" type="text/javascript" charset="utf-8" src="../../TableTools/media/js/TableTools.js"></script> 
     <script class="include" type="text/javascript" charset="utf-8" src="../../TableTools/media/js/ZeroClipboard.js"></script> 
     <script class="include" type="text/javascript" charset="utf-8" src="../media/js/dataTables.editor.js"></script> 

     <script class="include" type="text/javascript" charset="utf-8" src="support/bootstrap/js/bootstrap.js"></script> 
     <script class="include" type="text/javascript" charset="utf-8" src="support/bootstrap/dataTables/dataTables.bootstrap.js"></script> 
     <script class="include" type="text/javascript" charset="utf-8" src="support/bootstrap/dataTables/dataTables.editor.bootstrap.js"></script> 

     <script class="include" type="text/javascript" charset="utf-8" src="./js/custom.js"></script> 

    </head> 
    <body class="c_body"> 
     <div class="mContainer"> 
      <div id="dt_div"> 
       <table class="table table-striped table-bordered display" id="example"> 
        <thead> 
         <tr> 
          <th style="text-align: center;">Data</th> 
          <th style="text-align: center;">Tema</th> 
          <th style="text-align: center;">V&iacute;nculo</th> 
          <th style="text-align: center;">Empresa</th> 
          <th style="text-align: center;">Sub contratada</th> 
          <th style="text-align: center;">NDP</th> 
          <th style="text-align: center;">CH</th> 
          <th style="text-align: center;">HHT</th> 
          <th style="text-align: center;">Ger&ecirc;ncia</th> 
          <th style="text-align: center;">&Aacute;rea Solicitante</th> 
          <th style="text-align: center;">CC</th> 
          <th style="text-align: center;">Rateio</th> 
         </tr> 
        </thead> 
       </table> 
      </div> 
      <div class="spacer"></div> 

     </body> 
    </html>  

risposta

5

strano come può sembrare sono riuscito a risolvere il problema per IE8, senza apparentemente causare alcun danno a Firefox o Chrome utilizzando questo in JavaScript

<script language="javascript"> 
    window.onfocus = function(){ 
    var title_var = document.title; 
    document.title = title_var; 
    } 
</script> 

Come suggerisce Charly H onload potrebbe essere utilizzato anche

<script language="javascript"> 
    window.onload = function(){ 
    var title_var = document.title; 
    document.title = title_var; 
    } 
</script> 
+2

So che questo post è già vecchio di 1 anno, ma per le altre persone che cercano una correzione, cambiare window.onfocus a window.onload è una soluzione migliore. Ma ancora una bella soluzione a questo problema. –

+0

Questo era lo script completo originale sul post di notawizard. https://wordpress.org/support/topic/slider-glitch-after-clicking-on-other-browser-tabs Solo per questa parte hai probabilmente ragione, l'onload sarebbe meglio. Sorprendentemente non è stato ancora risolto in Edge. (notawizard sono io su WordPress) – Steve

+0

Ulteriori sperimentazioni hanno rivelato che 'onfocus()' era più affidabile dato che quando le schede venivano scambiate attivava l'evento 'onfocus()' ma non necessariamente un evento 'onload()'. – Steve

Problemi correlati