Skip to content

Instantly share code, notes, and snippets.

@jomasero
Created June 25, 2014 19:18
Show Gist options
  • Select an option

  • Save jomasero/5f3f1e410e9d216e366c to your computer and use it in GitHub Desktop.

Select an option

Save jomasero/5f3f1e410e9d216e366c to your computer and use it in GitHub Desktop.
Eventos personalizados con jQuery.
function holaEvento(datosE) {
alert("Número = " + datosE.numero + ", palabra: " + datosE.palabra);
}
$(document).on("nombreEvento", function(evento) {
holaEvento(evento.datosEvento);
});
$.event.trigger({
type: "nombreEvento",
datosEvento: {
numero: 2,
palabra: "Hola"
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment