Javascript event chaining / binding
- by Charlie Brown
I have a select list which has a function with a jQuery .post bound on the change() event.
<select id="location">
<option value="1"></option>
<option value="2"></option>
</select>
$('#location').change(location_change);
function location_change(){
var url = '';
$.post(url, callback);
}
What I would like to happen is other controls on the page can bind to the $.post callback function like it was an event, so after the location is changed the data is posted back to the server and once the post returns successfully, the subscriber events are fired.