var subscription = []; //set this on global level or under global function
//you can add any function to subscription
subscription.push(function(){
alert("It is ready!");
});
subscription.push(function(){
alert("It is really ready!");
});
//call this function when your event is ready
function notify() {
for (var item in subscription) {
subscription(item)();
}
//if you want to clear the subscription after execution then uncomment the following line
//subscription=[];
}