Javascript only works if the console is open in IE

Asked

Viewed 81 times

0

Good morning, I’m new here with a very boring problem.

I use a function to update a div every 5 seconds. In all search engines it works normally, only in the IE that stopped working.

@CHARSET "ISO-8859-1";

.filaAtual{
    /*border: 1px solid #000;*/
    min-height: 120px;
    height: auto;
    padding-left: 20px;
    margin-bottom: 10px;

}

.filaEstatistica{
    /*border: 1px solid #000;*/
    min-height: 120px;
    height: auto;
    padding-left: 20px;
    margin-bottom: 10px;
}

.estadoAgentes{
    /*border: 1px solid #000;*/
    min-height: 150px;
    height: auto;
    padding-left: 20px;
    margin-bottom: 20px;
}

.chamadas{
    /*border: 1px solid #000;*/
    min-height: 150px;
    height: auto;
    padding-left: 20px;
    margin-bottom: 10px;
}

.ramais{
    /*border: 1px solid #000;*/
    min-height: 150px;
    height: auto;
    padding-left: 20px;
    margin-bottom: 10px;
}

.URA{
    /*border: 1px solid #000;*/
    min-height: 150px;
    height: auto;
    padding-left: 20px;
    margin-bottom: 10px;
}

.nivelServicoOk{
    border: 1px solid #c0c0c0;
    min-height: 30px;
    height: auto;
    padding-top: 5px;
    border-radius:25px;
    -moz-border-radius:25px;
    -webkit-border-radius:25px;
    -khtml-border-radius: 25px;
    background:#eee;
    font-size: 18px;
    text-align: center;
}
.nivelServicoWarning{
    border: 1px solid #cc6600;
    min-height: 30px;
    height: auto;
    padding-top: 5px;
    border-radius:25px;
    -moz-border-radius:25px;
    -webkit-border-radius:25px;
    -khtml-border-radius: 25px;
    background:#ff8040;
    font-size: 18px;
    text-align: center;
}
.nivelServicoDanger{
    border: 1px solid #9f0000;
    min-height: 30px;
    height: auto;
    padding-top: 3px;
    border-radius:25px;
    -moz-border-radius:25px;
    -webkit-border-radius:25px;
    -khtml-border-radius: 25px;
    background:#ff0000;
    font-size: 16px;
    text-align: center;
}

.nivelServicoDanger p{
    animation: blinker 1s infinite;
    vertical-align: center;
    padding-top: 5px;
    font-size: 18px;
}

.blink {
  animation: blinker 1s linear infinite;
  color: red;
  font-weight: bold;
  font-size: 38px;
  text-align: center;
}

@keyframes blinker {  
  5% { opacity: 0; }
}

.tabelaDados{
    width: 80%;
    border-spacing: 10px;
    border-collapse: collapse;

}
.tabelaDados td:nth-child(1) {background: #fff}
.tabelaDados tr:nth-child(even) {background: #E5F1F9}
.tabelaDados tr:nth-child(odd) {background: #FFF0D9}

.td_titulos{
    width: 50%;
    text-align: right;
    padding-right: 5px;
}

.td_dados{
    text-align: left; 
    padding-left: 5px;
}

.td_headAgentes{
    text-align: center;
    background: #dbdbdb; 
    margin-left: 5px;
    margin-right: 5px;
    width: 25%;

}
<html lang="pt-br">

<head>

    <link rel="shortcut icon" href="Imagens/favicon.png" type="image/x-icon">



    <!-- Bootstrap Core CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="css/dashboard.css" rel="stylesheet">



   <script type="text/javascript" language="javascript" src="js/jquery_ATUALIZA.js"></script>


    <script src="js/ajusta_padding.js"></script>


<?php
    include_once 'bars/navbar2.php';
    //include_once 'bars/navbar3.php'
?>

</head>

<body>

    <!-- Navigation -->


    <!-- Page Content -->
    <div class="container" >
       <div class="col-lg-10 col-md-offset-2">
            <div id="refresh" class="row" style="z-index: -2px;">             </div>
        </div>   
    </div>


</body>

</html>
<script type="text/javascript" language="javascript">


        function atualiza(){

            console.log("atualizou");
            $('#refresh').load('pegaDashboard.php');
            return true;

        }


        $(function(){
            console.log("Inicou");

            window.setInterval(atualiza, 5000);
            $("[data-toggle=popover]").popover({
                html: true, 
                content: function() {
                    return $('#popover-content').html();
                }
            });
            atualiza();


        }); 

    </script>

However, this works, except in IE, but if I open the console in it, it starts running.

Someone has had this problem?

  • 5

    Puts HTML and CSS as well. Edits the question and puts the rest of the code, without it does not simulate your problem

  • Really, I have no idea why it doesn’t work. It even runs the function but doesn’t update the div. And only updates the div if the console is open. Weirdest.

  • Solved, had include too much, the rest of the browser can handle already IE is disgusting.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.