Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

132
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!