DIV update

1
Hello, I'm having a small project just for Hobbie, and I have some DataTables on my Web page, to make it easier to search for registered data, but when I register any data in one Brownser flip, the other does not appear at least I give a refresh / reload / f5 page, how would I automate this refresh?

<div class="tab-pane" id="tab7">                    
<div class="content-box-large">
    <div class="panel-heading">
        <div class="panel-title">Área de Serviço</div>
        <div class="panel-options">
            <a href="#" data-rel="collapse"><i class="glyphicon glyphicon-refresh"></i></a>
        </div>
    </div>
    <div class="panel-body panel-refresh" id="refresh4">
        <div class="refresh-data">
            <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="example4">
                <thead>
                    <tr>
                        <th>Código</th>
                        <th>Área de Serviço</th>
                    </tr>
                </thead>
                <tbody>
                    <?php
                        $consultar_area_servico = "SELECT * FROM '$tabela_area_servico'";
                        $resultado_consultar_area_servico = mysql_query($consultar_area_servico);
                        $quantidade_resultado_area_servico = mysql_num_rows($resultado_consultar_area_servico);
                        for($i = 0;$i < $quantidade_resultado_area_servico; $i++)
                        {
                            $vetor_area_servico = mysql_fetch_array($resultado_consultar_area_servico);
                    ?>
                    <tr class="gradeA">                                         
                        <td><button type="button" class="btn btn-default btn-block btn-xs" data-toggle="modal" data-target="#myModalAS<?php echo $vetor_area_servico['codigo'];?>"><?php echo $vetor_area_servico['codigo']; ?></button></td>
                        <td><input class="form-control"   type="text" name="c_area_servico" value="<?php echo $vetor_area_servico['area_servico']; ?>"></td>
                    </tr>

                    <div class="modal fade" id="myModalAS<?php echo $vetor_area_servico['codigo'];?>" role="dialog">
                        <div class="modal-dialog">
                            <!-- Modal content-->
                            <div class="modal-content">
                                <form action="web/acoes.php" method="post">
                                    <input type="hidden" name="confirma" value="8">
                                    <input type="hidden" name="c_cod" value="<?php echo $vetor_area_servico['codigo'];?>">
                                    <div class="modal-header">
                                        <button type="button" class="close" data-dismiss="modal">&times;</button>
                                        <h4 class="modal-title">#<?php echo $vetor_area_servico['codigo'];?></h4>
                                    </div>
                                    <div class="modal-body">
                                        <p>Área de Serviço:<input class="form-control"  type="text" name="c_area_servico" value="<?php echo $vetor_area_servico['area_servico']; ?>"></p>
                                        <center>
                                            <button type="submit" name="button" value="1" class="btn btn-danger btn-sm">Excluir</button>
                                            <button type="submit" name="button" value="2" class="btn btn-success btn-sm">Alterar</button>
                                        </center>
                                    </div>
                                    <div class="modal-footer">
                                        <button type="button" class="btn btn-default" data-dismiss="modal">Fechar</button>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                    <?php
                        }
                    ?>
                </tbody>
            </table>
        </div>
    </div>
</div>

    
asked by anonymous 25.10.2017 / 14:58

1 answer

-1

If you have two tabs open to the same system and have an insert in one of them. You can not control the other open flap, only the one that is focused. What I could do if this was the case is to put a autorefresh from time to time on your page. Or maybe I did not get your question right. If this is the case of autorefresh just insert in your javascript page you want to refresh the code below.

setTimeout(function(){
   window.location.reload();
}, 5000); //vai atualizar a página de 5 em 5 segundos
    
25.10.2017 / 15:47