[jQuery] Re: Syntax Question

2009-11-17 Thread jhsveli
I'd change it to var init_number_of_bikes = function(id_parameter){ then you'll have the parameter as a variable 'id_parameter' in your function. note that if it is called without the parameter, it will be undefined, you can do this to use a default value: var safe_to_use_id = id_parameter || 0

[jQuery] Re: Syntax Question

2009-11-17 Thread heohni
Sorry, I was just blind Thanks!! On 17 Nov., 12:20, Michel Belleville wrote: > It would help if your function was ready to receive this additional > parameter wouldn't it ? > > var init_number_of_bikes = function(chosen_id) { ... }; > > Then you could use the value. If someone calls the funct

[jQuery] Re: Syntax question regarding value of currrent element being clicked.

2008-05-13 Thread Eric Ongerth
Do you understand why? It's not the event that has the value that you wish to submit. What has the needed value is the object whose "onchange" callback is currently being executed. And since we're in that callback at the moment, it just so happens that the identifier "this" refers to the callba

[jQuery] Re: Syntax question regarding value of currrent element being clicked.

2008-05-12 Thread Pickledegg
Thanks andrea ;) On May 12, 12:27 pm, Pickledegg <[EMAIL PROTECTED]> wrote: > Sussed it: > > $('this').val() does the trick! > > On May 12, 12:05 pm, Pickledegg <[EMAIL PROTECTED]> wrote: > > > Heres my code: > > > This fires on any dropdown with the class 'ajaxdropdown': However, it > > errors t

[jQuery] Re: Syntax question regarding value of currrent element being clicked.

2008-05-12 Thread Pickledegg
Sussed it: $('this').val() does the trick! On May 12, 12:05 pm, Pickledegg <[EMAIL PROTECTED]> wrote: > Heres my code: > > This fires on any dropdown with the class 'ajaxdropdown': However, it > errors telling me that event.val() is not a function. How do I refer > to the current dropdown being

[jQuery] Re: Syntax question regarding value of currrent element being clicked.

2008-05-12 Thread andrea varnier
On 12 Mag, 13:05, Pickledegg <[EMAIL PROTECTED]> wrote: > How do I refer > to the current dropdown being changed, and get its value? hi :) you should use $(this).val()

[jQuery] Re: syntax question

2008-02-15 Thread Alexandre Plennevaux
argl indeed, it's Kelvin Luck i confused you with :) sorry! On Feb 15, 2008 11:18 PM, Mike Alsup <[EMAIL PROTECTED]> wrote: > Hi Alex, > > You have me confused with someone else. As much as I'd love to spend two > years in NZ, I've never done so (yet). I don't even have a blog! :-) And > you

[jQuery] Re: syntax question

2008-02-15 Thread Mike Alsup
Hi Alex, You have me confused with someone else. As much as I'd love to spend two years in NZ, I've never done so (yet). I don't even have a blog! :-) And you don't have to google for Mike Geary, he posts here often (but not often enough!) Cheers! Mike On Fri, Feb 15, 2008 at 5:13 PM, Ale

[jQuery] Re: syntax question

2008-02-15 Thread Alexandre Plennevaux
it does help.and i'll immediatly google up "michael geary" :) on a side note, i'm thinking about migrating to New Zealand. I read on your blog you spent 2 years there. How was it like? Did you enjoy it? Pros and cons ? feel free to use my email alexandre(AT)lab-au.com... thank you again ! On Fe

[jQuery] Re: syntax question

2008-02-15 Thread Mike Alsup
Hi Alex, Sorry for the short response earlier. Functions have 'apply' and 'call' methods which you can use to control the value of 'this' when the function executes. So in my example, I invoke onIni by calling its apply method, and I pass it 'this' which at the time is a DOM element, so when onI

[jQuery] Re: syntax question

2008-02-15 Thread Alexandre Plennevaux
Well, it's now tested, and it works!! I'm very sorry for this probably stupid question, i'm learning javascript from scratches. Could you explain or point me to the theory behind this? thank you so much alex On Feb 15, 10:14 pm, "Mike Alsup" <[EMAIL PROTECTED]> wrote: > Alexandre, > > This is

[jQuery] Re: syntax question

2008-02-15 Thread Mike Alsup
Alexandre, This is untested, but I think it's closer to what you're looking for: $.fn.myplugin= function(options,callback) { return this.each(function(index) { this.uniq = 'iAmNumber_' + index; options.onIni.apply(this); }); } On Fri, Feb 15, 2008 at 4:00 PM, Alexa