See what happens if you do this:
var simplefunction = function(){ alert('howdy!'); }
new Form.Element.DelayedObserver( 'inputfield', .50,
simplefunction); //just the var name of the function, no parens after
it...
I think this might be one of those issues where you mean to name a
function instead of calling it.
Walter
On Oct 28, 2008, at 1:22 PM, ecb wrote:
>
> I need it once. I've done some testing on this. Everything in the
> callback function is called twice. In fact, the callback function is
> initialized twice when the page is loaded, which I confirmed by
> putting an alert in the initialize block of the class definition (in
> controls.js).
>
>
> On Oct 23, 10:05 am, kangax <[EMAIL PROTECTED]> wrote:
>> On Oct 21, 2:30 pm, ecb <[EMAIL PROTECTED]> wrote:
>>
>>> Here's the code. It's simple enough:
>>
>>> <blockquote>
>>
>>> new Form.Element.DelayedObserver( 'inputfield', .50, function()
>>> { simplefunction(); })
>>
>>> function simplefunction() { alert("here I am"); }
>>
>>> </blockquote>
>>
>>> The problem I'm having is that "simplefunction" is being called
>>> twice.
>>
>> How many times do you need it to be called?
>>
>>
>>
>>> Best
>>
>>> Adam
>>
>> --
>> kangax
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---