Possible Duplicate:
How to order events bound with jQuery
I have bound two event for the same element.Let's say Button:
<button>Click</button>
<script>
/*First Event*/
$('button').click(function(){
/***Have some piece of code which gets the data that is used for next event***/
});
/*Second Event*/
$('button').click(function(){
/***do some operations with the data that has been fetched from the previous event***/
});
</script>
Now, whenever click is triggered on the button, two events are called simultaneously..So I cannot acheive my goal as what I guess.
Can we restrict the event should be calle onced the first event has finished its job....
Note: Above code is psuedo code to explain my issue..