• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

callback in javascript

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all!

I am looking to know how to handle a callback of an event, before it performs the default href function.

<code>
<a href = '<?php $url ?>' onclick = myFunction(); return true;>Click Here
</code>

I want the onclick event to finish completing and then perform the default href function, which is denoted by the "return true". The javascript "myFunction()" opens a window in a pop-up and it has a submit button in it. I would like to wait till this page loads in the pop-up window and only after the user clicks on the close button, the default href function needs to be carried out.

I cannot figure out on how to get the callback from this event.
Any help is appreciated!

Thanks !
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're approaching it incorrectly. You can't do it synchronously like you described.

Your link should open the window and not worry about the next step.

When the child window is closed, it should initiate whatever action is to come next.
 
reply
    Bookmark Topic Watch Topic
  • New Topic