Trying to run the synchronously code on page 27 I keep getting this error:
Uncaught TypeError: Object [object global] has no method 'queue'
I've copied directly out of here to make sure I am not typing it wrong.
function synchronously(tasks){
var i, task, func,
promise = $.Deferred().resolve().promise(),
makeRunner = function(func, args){
return function(){
return func.apply(null, args).promise();
};
};
for (i = 0; i < tasks.length; i++){
task = tasks[i];
func = task.shift();
promise = promise.then(makeRunner(func, task));
}
return promise;
}
$(document).ready(function() {
var promise = synchronously([
[ $('#btn1').animate, { opacity: 0.25 }, 100 ],
[ $('#btn2').animate, { opacity: 0.75 }, 200 ]
]);
});
I have two buttons on a basic html5 page.