Re: [jQuery] Scope a variable to a plugin

2007-03-14 Thread Sam Collett
On 14/03/07, Tom Holder <[EMAIL PROTECTED]> wrote: > Thanks for that Sam. > > One further thing you might be able to help with. I have a function that > loops through some elements and then inside attaches a click even that > results in the HTML being reloaded... hence I need to call the function f

Re: [jQuery] Scope a variable to a plugin

2007-03-14 Thread Tom Holder
Hi Klaus, Thanks for that, I'll try and absorb that over a cup of tea :) Any idea about my question about calling a jquery plugin function from within itself? Thanks Tom On 14/03/07, Klaus Hartl <[EMAIL PROTECTED]> wrote: Tom Holder schrieb: > Cheers Sam, > > That doesn't make a lot of sense

Re: [jQuery] Scope a variable to a plugin

2007-03-14 Thread Tom Holder
Thanks for that Sam. One further thing you might be able to help with. I have a function that loops through some elements and then inside attaches a click even that results in the HTML being reloaded... hence I need to call the function from within itself. My code looks like (I've put a note in

Re: [jQuery] Scope a variable to a plugin

2007-03-14 Thread Klaus Hartl
Tom Holder schrieb: > Cheers Sam, > > That doesn't make a lot of sense to my I have to be honest. > > 1. Why are you starting with (function($) > 2. Why $.fn inside this block? why not jQuery.fn > 3. What's (jQuery) on the end of the function? > > Sorry... OO Javascript is a whole new world of P

Re: [jQuery] Scope a variable to a plugin

2007-03-14 Thread Sam Collett
On 14/03/07, Tom Holder <[EMAIL PROTECTED]> wrote: > Cheers Sam, > > That doesn't make a lot of sense to my I have to be honest. > > 1. Why are you starting with (function($) This means that it would execute immediately and any variables contained within the function won't be seen by other scripts.

Re: [jQuery] Scope a variable to a plugin

2007-03-14 Thread Tom Holder
Cheers Sam, That doesn't make a lot of sense to my I have to be honest. 1. Why are you starting with (function($) 2. Why $.fn inside this block? why not jQuery.fn 3. What's (jQuery) on the end of the function? Sorry... OO Javascript is a whole new world of Pain for me! :) Thanks Tom On 14/03/

Re: [jQuery] Scope a variable to a plugin

2007-03-14 Thread Sam Collett
On 14/03/07, Tom Holder <[EMAIL PROTECTED]> wrote: > Bit of a simple question this I'm sure but how do I scope a variable to a > plugin I'm creating and not expose it beyond my plugin? I do want the > variable to be accessible to all the methods in my plugin though. > > Thanks > Tom You could wri

[jQuery] Scope a variable to a plugin

2007-03-14 Thread Tom Holder
Bit of a simple question this I'm sure but how do I scope a variable to a plugin I'm creating and not expose it beyond my plugin? I do want the variable to be accessible to all the methods in my plugin though. Thanks Tom ___ jQuery mailing list discuss@