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

334
Vistas
How to trigger a link in a tab of a table?

When a user is on the home page, he can click on a link that redirects him to another page (so far, it works). In the new page, I would like the link to automatically open the second tab of a table by doing an "auto click" (trigger).

The link of the home page is specific (it has an anchor). I managed to make a script that works, the problem is that if I open this page from the navigation menu, the second tab of the table still opens.

I would like that only the specific link can automatically open the second tab of the table.

Landing Page Service Page

Here is the code I used:

$(document).ready(function(){
    $('#test').click(function(){
        console.log('clicked');
       });
     // set time out 5 sec
        setTimeout(function(){
           $('.et_pb_tab_3 > a').trigger('click');
       }, 500);
       console.log('triggered');
   });

Thanks a lot for helping.

Best regards,

Johann

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

A url parameter may get the job done for you. From the link you want to open you could do something like: example-link.com?showTable=True.

Then look for that url parameter on the new page and only open if it's there and True.

example-link.com#rebozo?showTable=True

const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const product = urlParams.get('showTable')
if (showTable && showTable === 'True') {
    // code to open the table
}

https://www.sitepoint.com/get-url-parameters-with-javascript/

about 4 years ago · Juan Pablo Isaza Denunciar

0

Ok so it was easy and i'd like to thanks @Branson Smith for inspiration.

i just had i conditional statement to check if there is a hash in the url :

if (window.location.hash == '#myHash') {
    $(document).ready(function(){
        $('#myID').click(function(){
            console.log('clicked');
           });
            setTimeout(function(){
               $('.myClass > a').trigger('click');
           }, 2000);
           console.log('triggered');
       });
};
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