Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

133
Visualizações
Call and Register java script

I was trying to have a google iframe and for automation we were rendering our own iframe (By loading my url and gapi.iframes.getContext().openChild(options). Now I was not getting how to callback to the registered function on button click.

iframe.register('onproductselect', function(event) {
  console.log(event);
}, gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER);

How can i call this above function when a dummy button is clicked ?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Declare the function outside of the listener. You can have the name of the function in the listener and call it wherever you want in your code (in the right scope).

function productSelectEvent(event) {
  console.log(event);
}
iframe.register('onproductselect', productSelectEvent, gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER);
productSelectEvent({/* Custom event object */});
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda