[jQuery] Passing in a parameter

2010-01-17 Thread Patrick
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

Re: [jQuery] Passing in a parameter

2010-01-17 Thread brian
Do you have some function inside of the ready() block that you could pass the data to instead? Could you post some of your code? On Sat, Jan 16, 2010 at 11:57 PM, Patrick kenned...@gmail.com wrote: Hi all, I have a newbie question. You know how you can pass a variable to a JavaScript function

Re: [jQuery] Passing in a parameter

2010-01-17 Thread Michael Geary
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