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

251
Vistas
jQuery fire an event and receive it

I want to fire event globally and receive it anywhere in my application. Based on the event received, I want to perform some operations.

I have a multistep form when user click the next button, I want to trigger an event

function multiStep(){
    $('.body').trigger('stepchanged');

}

Now I want to receive stepchanged in another function and perform some operations.

if (stepchanged){
//do something
} 

How to receive the events? Thanks

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

0

You need an event handler that sets the variable.

`$(".body").on("stepchanged", function() { 
    stepchanged = true;
})`

Although there's not really any need for the event handler, unless it does other things. You can just set the global variable in multistep().

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