I'm assuming the use of jQuery? (It's a good idea to let us know that up front.)
I'm not even sure what you are trying to do here? Why do you have a declaration passed to the jQuery function in the first place? It'll work to establish the function as a ready handler, but it's really really odd.
What is your actual intention?
And to answer the specific question: var is used within non-global scopes to limit the scope of a variable to the current function. Without var, implicitly declared variables will become part of the global scope.
Thanks for the reply, Mr. Bibeault.
Yes, I forgot to mention the use of jQuery.