Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

177
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda