I guess what I'm having trouble coming to grips with is that Tobie
feels that buying another book solves problems and that I don't
read. Ah skip that, it's late and one side of my brain has gone to
sleep already. I can ignore that.
The thing is that setTimeOut takes two arguments, the thing you want
to execute when the timer zeros and the the timer value setTimeOut
('thing', timervalue). Now how the heck does the 'thing', return a
value that causes the timer to timeout quicker? I haven't found any
doucmentation that says your function ( even a function with no return
value ) can cause setTimeOut to do that.
What I have found is ...
http://www.codingforums.com/archive/index.php/t-105253.html
http://www.daniweb.com/forums/thread89100.html
http://www.eggheadcafe.com/software/aspnet/31902144/bug--multiple-javascrip.aspx
http://bugs.sakaiproject.org/jira/browse/SAK-13125
http://groups.google.com.au/group/Google-Maps-API/browse_thread/thread/4993c4e20f803bc3
http://forums.aspfree.com/html-javascript-and-css-help-7/settimeout-not-working-in-ie7t-261430.html
and more ...
I had read one or two that related to memory leaks and that's why I
wondered.
But OK, I'm going to go retest on FF. And relook at the way I am
using setTimeout.
As for those who suggested that I could somehow use onSuccess: in
Ajax.Request to put off further processing until that event occurred,
the answer is no, it doesn't wait. OnSuccess: function ()
{ doFutherProcessing() } will do the futher processing before the
results of the CGI script are returned. I have thoroughly test this.
So Success is apparently determined before the script's return values
are available. Rude to be sure.
It doesn't work. So I have to use setTimeOut() to get the proper
delay to continue processing. And that works. But my setTimeOut()
problems currently have nothing to do with Ajax.Request() and
everything to do with CSS dropdown Menus that don't always want to
stay open for the delay time I set.
Sorry, I didn't make that clear.
BearState
On Mar 2, 11:45 pm, "Alex Mcauley" <[email protected]>
wrote:
> myTimeout=setTimeout(function(var,var2,var3,var4) {
> global x,y,z;
>
> alert('foo = bar');
>
> },5000);
>
> whats wrong with that ?
> I dont think this leaks memory so why should any timeout leak memory
>
> Alex
>
>
>
> ----- Original Message -----
> From: "BearState" <[email protected]>
> To: "Prototype & script.aculo.us" <[email protected]>
> Sent: Tuesday, March 03, 2009 3:36 AM
> Subject: [Proto-Scripty] Re: IE7 Timers & Memory Leaks?
>
> Hi Tobie,
>
> You don't live over in Scott's Valley, do you? Used to know a Tobie
> way back when.
>
> OK so,
>
> xtimer = setTimeout( { doSomething( arg1, arg2, arg3 ); }, 500);
>
> is using the function's return?
>
> How do I specifiy a function to setTimeout when it has args?
>
> Holy Simple Minded Idiot Batman! It's not a timer memory leak
> problem.
>
> Riddle me this Robin ... do you think this programmer could use some
> Bat Belt and Suspenders?
>
> Holy Mistaken Bug Identity Batman! Definitely!
>
> BearState
>
> On Mar 2, 6:55 pm, Tobie Langel <[email protected]> wrote:
> > Hi again, BearState.
>
> > Your confusing different things here.
>
> > The behaviour you are describing isn't related to memory leaks at all,
> > your most probably just passing the _result_ of a function call to
> > setTimeout rather than the function itself.
>
> > In other words, if you are doing the following, you're almost
> > certainly doing something wrong (or using some very obscure functional
> > programming tricks):
>
> > setTimeout(myFunc(), 1000); // WRONG
>
> > This, on the contrary, works you're passing the function itself, not
> > the _result_ of it):
>
> > setTimeout(myFunc, 1000); // CORRECT
>
> > Anyway, if you're doing ajax requests, you should NOT be using
> > timeouts, but the provided callback system (as advised in a previous
> > post).
>
> > I suggest you buy yourself a good book on Prototype[1] and maybe one
> > on JavaScript too, while you're at it. ;)
>
> > Best,
>
> > Tobie
>
> > [1]http://prototypejs.org/2008/8/11/practical-prototype-and-scriptaculous
> > orhttp://prototypejs.org/2007/5/7/prototype-and-script-aculo-us-the-bun...
>
> > On Mar 3, 1:43 am, BearState <[email protected]> wrote:
>
> > > Hidie-ho,
>
> > > Well Ok, I've used setTimeout a few times in my code to delay resuming
> > > run of a code module until Ajax.Request() has had time to do its
> > > thing. And the use of the timer is cyclic as the user may repeat the
> > > operation over and over again, but in different parts of the page.
>
> > > And ... holy spacetime wormhole continuum out of wack batman! Why is
> > > that timer firing off so quickly? What in the wide wide world of
> > > sports is go'n on?
>
> > > Robin, haven't you done a web search yet? There's people complaining
> > > about memory leaks with regard to timers?
>
> > > Holy abscent minded browser batman! Is it the setTimeout() function
> > > causing the problem?
>
> > > Damned if I know Robin, I only stomp on Penquins and Jokers, not
> > > memory leaks and I'm not int he habit of waiting for anything, not
> > > even queues at the bank when I cash my checks.
>
> > > Holy Fast Food Diet out the window with Cheese, Fries and Shake
> > > Batman! What's the answer?
>
> > > You weren't listening Robin ... damned if I know.
>
> > > Does anyone know?
>
> > > BearState- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---