I have a button (say, button A) which forwards its click event onto another button (say, button B.)
$("#buttonA").click(function()
{
$("buttonB").click();
});
But now I want it to do something else in a callback function after the button B event completes when it's triggered from button A. The problem is, the syntax I would expect to use is identical to binding a click event to button B instead:
$("#buttonA").click(function()
{
$("#buttonB").click(function()
{
alert("I want this to happen only after buttonA is clicked and buttonB's onclick event finishes.")
});
});
I understand why the above won't work, but what should I be doing here instead?
Note: ButtonB is doing an asynchronous ajax form submission.