someFunction is not defined in global scope, so you need to define it: //Define variable var someFunction = {};
$(document).ready(function() { //Assign a function to the variable someFunction = function() { // some function that does stuff }; }); $(document).ready(function() { someFunction(); // a function that exists in another ready() block }); On Dec 14, 10:56 pm, js <[EMAIL PROTECTED]> wrote: > Hi, > > I know it's possible to use multiple $(document).ready() blocks, but it > seems as though you are unable to make function calls across the > different blocks, eg: > > $(document).ready(function() { > var someFunction = function() { > // some function that does stuff > }; > > }); > > $(document).ready(function() { > someFunction(); // a function that exists in another ready() block > > }); > > This results in a "someFunction is not defined" error. Is there a way > around this, or is it not possible? > > Thanks, > -j