If your current code in the body tag is literally:
onload="getStuff(data)"
then 'data' must be a global variable. You can reference this global
variable directly in any of your JavaScript code. For example:
$(document).ready( function() {
getStuff( data );
});
If that's not exactly what your code looks like, give a more specific
example and it will be easy to come up with some suggestions.
-Mike
On Sat, Jan 16, 2010 at 8:57 PM, Patrick <[email protected]> wrote:
> Hi all,
> I have a newbie question. You know how you can pass a variable to a
> JavaScript function like this:
>
> onload="getStuff(data)"
>
> Which is done via the BODY tag. Now, jQuery uses $(document).ready
> (function() });
>
> My problem is simple: I want to pass in a variable to the ready
> (function(). When the page is first loaded, how can I pass in a
> variable to this function, or what strategy should I imploy to do
> such?
>
> Thanks for the pointers. Pat
>