1

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")}
         );                     
    });

1 Answer 1

3

You could write it like this using auto-called anonymous functions:

http://jsfiddle.net/BSYDv/2/

$(document).ready( 
    function(){ 
          (function() { alert("1")})(), 
          (function() { alert("2")})(), 
          (function() { alert("3")})();                     
});
Sign up to request clarification or add additional context in comments.

1 Comment

Great, thank you. I will mark this as the answer when I'm allowed to do so.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.