Reputation: 483
I'm looking to run multiple jQuery functions one after another. There are several threads about this but they only ever seem to show how two functions are done. My second function doesn't seem to execute. Where have I slipped up? http://jsfiddle.net/BSYDv/
$(document).ready(
function(){
$(function() { alert("1")},
function() { alert("2")},
function() { alert("3")}
);
});
Upvotes: 1
Views: 1741
Reputation: 74420
You could write it like this using auto-called anonymous functions:
$(document).ready(
function(){
(function() { alert("1")})(),
(function() { alert("2")})(),
(function() { alert("3")})();
});
Upvotes: 3