2013-04-13 2 views
11

Wenn ich auf meine Seite zugreife, wird der Titel korrekt geladen, aber nach einer Sekunde ändert sich der Wert in "Waiting for http://example.com".

Ist das ein Fehler vom IE oder von meinem Code? - "Waiting for http://mysite.com"

Die Seite geladen wird, aber auch nach allem geladen ist, geht der Titel, sondern nur im IE Tab, weil in der Schale der Titel, wie es sein soll, ist.

PS: Es passiert nicht mit Chrome. Und die I.E Version ist 10

Bild der Ausgabe:
enter image description here

Mein HTML-Code:

<!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>  

Antwort

5

So seltsam es scheinen mag ich es, ohne anscheinend verursacht Schäden an Firefox oder Chrome für IE8 zu beheben verwaltet diese in JavaScript mithilfe von

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

Als Charly H schlägt onload auch

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

Ich weiß, dass dieser Beitrag ist bereits 1 Jahr alt, aber für andere Leute auf der Suche nach einer Lösung, window.onfocus zu window.onload ist eine bessere Lösung. Aber immer noch eine nette Lösung für dieses Problem. –

+0

Dies war das ursprüngliche vollständige Skript auf dem Post von Notawizard. https://wordpress.org/support/topic/slider-glitch-after-clicking-on-other-browser-tabs Für nur diesen Teil haben Sie wahrscheinlich Recht, onload wäre besser. Erstaunlicherweise wurde es immer noch nicht in Edge behoben. (Notawizard ist ich auf WordPress) – Steve

+0

Weitere Experimente ergab, dass "onfocus()" war zuverlässiger als wenn Tabs geschaltet wurde ausgelöst das "onfocus()" Ereignis, aber nicht unbedingt ein 'onload()' Ereignis. – Steve

Verwandte Themen