File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes callback in javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "callback in javascript" Watch "callback in javascript" New topic

callback in javascript

Aparna Ram
Ranch Hand

Joined: Jan 27, 2006
Posts: 59
Hello all!

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

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

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

Joined: Jan 10, 2002
Posts: 63865

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.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: callback in javascript
It's not a secret anymore!