Refresh page when closing a modal

1

How do I update a page whenever the modal is closed? because I have a problem that whenever I close the modal and I will open again it does not open ... so I need to update the page there it opens.

Modal used

<div class="modal fade bd-example-modal-lg" id="modalInfoMaq" role="dialog">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="modaleditcadastro">Informaçoes maquina:</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close" onclick="AtualizarPagina()">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <div class="container-fluid">
                        <div class="row">
                            <div class="col-lg-12">
                                <form>
                                    <div class="col-sm-6" style="display: none;">
                                        <div class="input-group input-group-lg" >
                                            <span class="input-group-addon" id="sizing-addon1">Numero Serie</span>
                                            <input type="text" class="form-control" name="serie_maquina" id="serie_maquina" readonly="readdonly">
                                        </div>
                                    </div>
                                    <div class="col-sm-6" style="display: none;">
                                        <div class="input-group input-group-lg" >
                                            <span class="input-group-addon" id="sizing-addon1">Modelo</span>
                                            <input type="text" class="form-control" name="grupo_maquina" id="grupo_maquina" readonly="readdonly">
                                        </div>
                                    </div>
                                </form>
                                <div class="row">
                                    <div id="maquina_carrega" class="col-8 col-sm-6">
                                    </div>
                                    <div id="maquina_carrega_rec" class="col-8 col-sm-6">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                </div>
            </div>
        </div>
    </div>

and the script that sends the data to the modal

<script>
$(document).on("click", "#btnInfoMaq", function () {
    var info = $(this).attr('data-id');
    var str = info.split('|');
    var serie_maquina = str[0];
    var grupo_maquina = str[1];
    $(".modal-body #serie_maquina").val(serie_maquina);
    $(".modal-body #grupo_maquina").val(grupo_maquina);
    console.log(serie_maquina);
    console.log(grupo_maquina);
    $.ajax({
        type:'post',
        url: 'info_maquina.php',
        data: {
            'serie':serie_maquina,
            'grupo':grupo_maquina
        },
        async:false,
        erro: function () {
            alert('erro');
        },
        success: function (data) {
            //$("#maquina_carrega").html(data);
            $("#maquina_carrega").html(data);
        }

    });
});

The problem is that when I open it once ... and close, when I try to open it again it opens and closes. and then do nothing else.

    
asked by anonymous 16.04.2018 / 16:28

1 answer

0

Use window.location.href to capture the current page and window.location.href = URL to redirect to a page.

Ex:

var urlAtual = window.location.href;
window.location.href=urlAtual; // aqui vai fazer o redirecionamento

:)

    
16.04.2018 / 19:43