Michael Geary wrote:
You're making it too complicated there, Dave. :-)
Now there's a first... not :)
This does not work:
jQuery ( function() { function test() {alert('here')} } );
test; // assume that test is defined at this point...
That's what didn't make sense. You want to define test later, but reference
it now? No, you can't do that.
Well the sample is simplified, hence the code-comment. What actually
happens is that test would be called based on a user triggered event, in
theory post-document ready.
I thought it might be something like this, but no joy there either:
localJQ = jQuery ( function() { function test() {alert('here')} } );
localJQ.test;
Hmm... What is it you *really* want to have happen? I have a feeling the
two-line examples are missing some key piece of information. If I can
understand it I can probably give you a more intelligent reply. :-)
I currently have a function being defined within a document ready block.
I'd like to be able to access that function outside of the document
ready block, within the 'normal' javascript scope. For the sake of this
case we can assume that we won't try to use the function before the
document is ready.
The reasons *why* I want to do that are historical, and historically
daft. But that's history for you ;)
Hope that helps clarify a little...?
~ ~ Dave