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

151
Vistas
Move to tab but don't reload

I'm using the code below with window.open to open a new link (same origin) in a new tab. If a tab with the new link is already open, the open tab should be focused instead.

This is all working fine, the focused tab is however always refreshed when it gains focus by this. How can I stop the focused tab from refreshing?

window.open(`./${_id}`, `module_${_id}`);
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Check if the window is closed orelse use focus(), this should not refresh the page.

    var windowObject = null; // global variable
    
        function openURL(url) {
          if(windowObject == null || windowObject.closed) {
            windowObject= window.open(url);
          } else {
            windowObject.focus();
          }
        }

<button value="Check" onClick="openURL('https://www.google.com')"></button>
about 4 years ago · Juan Pablo Isaza Denunciar
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