Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

173
Visualizações
Prevent Javascript caching $(document).keydown()

I have a list that I need to work with navigation buttons and after hitting enter it should run a function to execute ajax.

I load pages and my list inside (mainPage):

<div id="page_view1" class="d-none">
</div>
<div id="page_view2" class="d-none">
</div>
<div id="page_view3" class="d-none">
</div>

For every pages that should show inside another page I add it to mainPage using Javascript and when user hits cancel button I delete content of last page_view that has content.

In every page that loads is a Javascript tag when I delete all of content this tag removes too but browser caches the code and causes interference how can I prevent this.

My code that interferes event after removing from code:

    $(document).keydown(function (e) {
    
        var selectedRowIndex = table.row('.selected').index();
        switch (e.which) {
        case 38:
            if (selectedRowIndex > 0) {
                selectedRowIndex--;
                tbl2.rows().every(function (rowIdx, tableLoop, rowLoop) {
                    if (rowIdx == selectedRowIndex) {
                        this.select();
                    }
                });
            }
            break;
        case 40:
            if (selectedRowIndex < tbl2.rows().count() - 1) {
                selectedRowIndex++;
                tbl2.rows().every(function (rowIdx, tableLoop, rowLoop) {
                    if (rowIdx == selectedRowIndex) {
                        this.select();
                    }
                });
            }
            break;
        case 13:
            act_Select_1();
        case 27:
            load_last_view();
        }
    });
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda