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

246
Vistas
How to detect if a page is loaded into a named window?

Ok, I posted this question a month ago. Now I think I can rephrase it a bit, and maybe someone can understand my issue somewhat better now.

We´re using named windows to reuse tabs when the user is opening several links of the same type. Links to different products all open in a window named Products <a href='somepage' target='Product'>Product B</a>. Other collections leading to windows named Org.Info, News and so on.

The window name is displayed in the top bar for any "Named" window using this code in our shared layout-page.

<span id="windowname"></span>
    
<script>
        if (window.name.length > 0) {
            $('#windowname').text('Window: ' + window.name);
        }
</script>

All is working well, the window name is showing if it isn't empty, and the tab is reused as expected.

But if the user continue to browse in this named window I want the window.name to be cleared again, when the next page is loaded.

I tried with this script to clear it on window.unload, and it clear the window.name, but then the window reusing isn´t working anymore.

window.onunload = function () {
    window.name = '';
}

Is there a way to clear the name, only if the call doesn´t have a target window specified?

Something like this?

window.onunload = function () {
if(the call to open a new page in this window has a target.value !=window.name){
    window.name = target.value'';
}
}
about 4 years ago · Santiago Trujillo
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