• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

callback in javascript

 
Aparna Ram
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • 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 !
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64620
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic