[Proto-Scripty] Re: IE7 Timers Memory Leaks?
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 webmas...@thecarmarketplace.com 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 wixelb...@yahoo.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com 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 tobie.lan...@gmail.com 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 wixelb...@yahoo.com 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
[Proto-Scripty] IE7 Timers Memory Leaks?
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 --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[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 tobie.lan...@gmail.com 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 wixelb...@yahoo.com 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 - --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Creating Ajax.InPlaceEditor dynamically ... confusing the hell out of me.
Never mind! What I found is that the fix I put in for the 'onSuccess' in Ajax.Request() still did not satisfactorilly allow time to return the value from the CGI. Thought it did, but it didn't. Refer to the thread on 'Delay Required after Ajax.Request() ... How to?' for more info. I went back to using setTimeout() on the split part of the function and was then able to get the editor working. BearState On Mar 1, 11:36 am, BearState wixelb...@yahoo.com wrote: Hello again ... I want to thank the folks in this group. It's a good sounding board to keep from bashing away for hours on end. Nice quick responses from here have helped, especially while my head's been fogged over with the flu. Thanks. New Problem ... I have been able to successfully load up Ajax.InPlaceEditor objects and have them work during the load of my page using observe (DOM:LOAD). No problem. But I want to cure the problem of having multiple editors on my page. I want to create the editor on the fly and thus, solve two problems. 1) Only one editor object at any one time and 2) If I create a new object and insert it into the page, I can create an editor for it. But ... ( the awful 'but' ) I can't for the life of me, get the damn thing to work. I create divs for the controls ... div id='edClick' /div div script id='edAjax' language=javascript!-- //--/script /divBR Then I have a function to put the editor in play ... function editIT() { \$\(edClick).replace(A HREF='#' id='editThis'editThis/A); var theEditor = var newEditor = new Ajax.InPlaceEditor ('theText'', 'thescript.cgi', + { rows:10,cols:100,textBetweenControls:' ', + okControl:'link', + externalControlOnly:true, externalControl:'editThis', + callback: function(form, value) { return \ \theID=1value=\\ +escape(value) } + } );; \$\(edAjax).replace(theEditor); \$\(edClick).click(); } No Go. I've tried just doing the new Ajad.InplaceEditor() in the function, out of it, here, there, everywhere, but No Go. What am I doin wrong? BearState --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?
Woops! Take that back. It is NOT working right using onSuccess instead of setTimeout() over the split part of the module. Thought it was, but it was not. After having a hell of a time trying to dynamically plug the InPlaceEditor, I found out that onSuccess has little to do with successfully returning anything from the script. BearState On Mar 1, 11:21 am, BearState wixelb...@yahoo.com wrote: Thanks for the advice folks, Using onSuccess is the ticket. BearState We live, we learn ( we get over the flu! ) On Mar 1, 7:21 am, Quleczka qulec...@gazeta.pl wrote: Option #2 can be a smallish change, you don't need all the bells and whistles. :-) A very rough untested cut:http://pastie.org/403783 Thanks T.J. Your idea is similar to the one described above by Tobie. I've just missed the point that I can stop events earlier and add submit my form inside ajax callback. I don't know why but all the time I was thinking about stoping event inside one of callbacks. Thanks again guys - that's exaclty what I needed :) Quleczka p.s. I haven't seen pastie before - really useful - bookmarked already:)- 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?
Thanks for the feedback, I appreciate it.True, it would be nice to have a progress indicator. But I also said that the delay was not long, but long enough to be of consequence. Therefore, the progress indicator is not an issue. The issue is that the code is a modular response to a user click for some web page functionality and the code module runs on with processing w/o the data it needs to do the processing. I found it funny that calling the Ajax.Request() twice in a row provided just the right length of delay to get it right, but ... that's a bandaid and sucks. No, the only real solution here, is to split the module at the point of the Ajax.Request() call ( and it is a separate function - yes ) and create another module of the remainder. Then, call the remainder wrapped in a setTimeout(). That actually works fine and gives the required delay and further, control over how long the delay should be ... with capability for handling the exception of not getting the data from the call. It seems a bit klugey to me to do it that way, but it's not the first time I've seen how Javascript and HTML can be klugey. I said that some people might consider it a bug, because I'd seen posts on the web that decried 'Problems with Ajax' that likely are tied to not understanding that there is a delay involved in getting stuff back from the server. It is BTW and IMHO appropriate for the Request to allow the code to ramble on. All you have to do is consider a Web 2.0 that starts several requests while loading to understand how important it is to give the user something to do on the page while that stuff is background loading ... then, perhaps, make it visible. Who needs a progress indicator,when you don't even have to make the loaded data visible until you have it? No data? -- No Errors and just the page missing whatever it was. Wouldn't it be dumb to show a progress bar and then get no data? Anyhow, I've found a solution and will progress from that. Thanks again. BearState On Feb 27, 7:31 am, T.J. Crowder t...@crowdersoftware.com wrote: T.J., while I absolutely agree with what you have said, I think you're missing part of BearState's question: Thanks, Colin. On first read, I thought he meant some knucklehead *programmers* might think it was a bug *in Prototype*. But I think you're right. And yes, simply displaying something when there's an outstanding request should provide the appropriate feedback. In fact, the Ajax.Responders[1] are designed specifically for doing this (amongst other things), and they even maintain a handy how many requests are pending counter (Ajax.activeRequestCount) for you... [1]http://prototypejs.org/api/ajax/responders FWIW, -- T.J. Crowder tj / crowder software / com Independent Software Engineer, consulting services available On Feb 27, 2:57 pm, ColinFine colin.f...@pace.com wrote: On Feb 27, 6:21 am, T.J. Crowder t...@crowdersoftware.com wrote: Hi, Rather than thinking of an Ajax request as a function call, think of it as a message you send out. Send it, then get on with other things, or just wait (where waiting is not a busy-wait where the user can't do anything). When you get a reply, deal with the reply. In this case, replies are (basically) complete and failure. T.J., while I absolutely agree with what you have said, I think you're missing part of BearState's question: Some knuckleheads might well be provoked to say, Hey, I didn't get my data. There's a bug. The trick then is to make something happen visually to show the user that something is happening: an animated cursor, an hourglass, even just temporarily change the colour of something. Some Scriptaculous facilities provide this for you (see 'indicator' inhttp://wiki.github.com/madrobby/scriptaculous/ajax-autocompleter, for example, but I think you'll have to do it yourself with the basic Prototype Ajax classes. But it's not hard. You set something in the 'onCreate' callback, and remove or stop it in 'onComplete'. Colin- 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Delay Required after Ajax.Request() ... How to?
Hi, OK, so Mr. Noob has made a lot of progress, but has found that when he makes an Ajax.Request(), the response is not set into the javascript variables until after a certain amount of time, which though small, is significant. Some knuckleheads might well be provoked to say, Hey, I didn't get my data. There's a bug. There is no bug, but there is a pain in the ... Javascript does not have a sleep function and using setTimeOut in this situation is folly because you can not proceed with the code in any semblance until AjaxRequest full completes returning the data. setTimeOut will only cause one code element to deley. How're the Prototype/Scriptaculous gurus handling this? BearState aka. Mr. Noob ( for the moment ). --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?
Oh, One additional comment ... If I get clever and try to wait in a while loop for AjaxRequest to set a flag that it has completed, the browser complains that some script is attempting to make the browser to run slow, do you want to let it run? IE7. So no, I can't create a slick wait loop like that either. BearState On Feb 26, 9:13 pm, BearState wixelb...@yahoo.com wrote: Hi, OK, so Mr. Noob has made a lot of progress, but has found that when he makes an Ajax.Request(), the response is not set into the javascript variables until after a certain amount of time, which though small, is significant. Some knuckleheads might well be provoked to say, Hey, I didn't get my data. There's a bug. There is no bug, but there is a pain in the ... Javascript does not have a sleep function and using setTimeOut in this situation is folly because you can not proceed with the code in any semblance until AjaxRequest full completes returning the data. setTimeOut will only cause one code element to deley. How're the Prototype/Scriptaculous gurus handling this? BearState aka. Mr. Noob ( for the moment ). --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Cloning an Object -- A really big complex visual object, tags within tags
OK, I'm still new to prototype and scriptaculous and I don't like to ask, but I guess having the flu, I'm feeling kicked around enough to do so. And it appears to be a tough one anyhow. You have an unordered list which you have made sortable. It allows the item in the list to be edited and save back to the database. It also is intended to allow ... 1) deleting the item from the list. 2) inserting a new item in the list. and 3) cloning the item in the list. So if I identify my li /li by its id as $(id), how do I get a clone of this object with everything in between, make some modifications to ids in its content so it is unique and write the nasty critter back into the list? God, I hate the flu. Why you made us humans suffer the flu and have to defecate, I will never appreciate. Er ... uh, God, don't be offended. That's just my take on it. Amen. --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---
[Proto-Scripty] Ajax.InPlaceEditor must allow HTML but doesn't
Hello and Howdy Do! I'm working on something and Prototype and Scriptaculous are new to me. I've been hashing at it and learning it on my own, but I've finally relented and accept that maybe hearing from others who have already been there and done that is OK. ajaxOptions hasstripLoadedTextTags which I set to false and STILL, STILL can not get the editor to load text w/o stripping the HTML tags. It's start'n to T me off. I've also run accross some sample that shows how to extend Ajax.InPlaceEditor to supposedly do the trick, but that doesn't work either. Anybody out there know what I'm trying to do and how to do it? Please share your invaluable insights. BearState --~--~-~--~~~---~--~~ 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 prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~--~~~~--~~--~--~---