Real-time value for a variable

0

Hello everyone, I have the following code sending information to a script.

<!DOCTYPE html>
<html lang="pt">

<head>
    <meta charset="utf-8">
    <title>Javascript Example</title>
    <link rel="stylesheet" href="css/style.css">
</head>

<body>
    <label id="counter">0</label>
<script src="js/script.js"></script>
    <script src="js/jquery.min.js"></script>


    <script type="text/javascript">
        $(document).ready(function () {
            $.ajaxSetup({ cache: false });
            setInterval(function () {
                $.get("IOCounter.htm", function (result) {
                    $('#counter').text(result.trim());
                });
            }, 40);
        });

    </script>

    <button id='bot'> INICIAR TESTE </button>

<!--
    <div class='image-wrapper'>     
        <img src="img/aguard_teste.jpg" alt="">
    </div>-->

    <div id='pag-2' class='wait-test'>      
        AGUARDANDO TESTE
    </div>

    <div id='pag-1' class='wait-test'>      
        TESTANDO
    </div>


</body>
</html>

and sends the information to this script here

$('#bot').on('click', function(){
})

var i = 0;

setInterval( function () {
    $('#counter').text(i);
    i++;
    if ( i == 5.000000 ){
        $('#pag-1').show();
        $('#pag-2').hide();                     
    }
};

My question is how do I get the information that is playing in the webcounter and send it to the script for when I reach a certain value I change a specific page that I am creating in the webserver in a CLP?     

asked by anonymous 14.06.2017 / 14:46

0 answers