This is my code...
var _before = function () {
for (var i = 0; i <= 10000; i++) {
console.log(i);
}
};
var _appear = function () {
console.log('i am in the middle of it');
};
var _after = function () {
console.log('all done!');
};
jQuery.fn.doSomething = function() {
this.click(function() {
_before();
_appear();
_after();
});
};
$('#someButton').doSomething();
I want to build a queue inside the doSomething function to allow _before() to complete before firing _appear() and _appear() to complete before firing _after().
I cannot change the structure of the code.
Thanks