Re: [Proto-Scripty] Re: Progressive update messages from single request
Joe. Are you using ob_gz_handler(); or mod_defalte / mod_gzip ? Also is it a winblows or *nix server Alex Mcauley http://www.thevacancymarket.com - Original Message - From: joe t. thooke...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Saturday, December 12, 2009 2:24 AM Subject: [Proto-Scripty] Re: Progressive update messages from single request Alex, Thanks for the sample. i must be missing a piece somewhere though... http://pastie.org/739926 From that single Ajax.Request, the client delays, and after the PHP is done running, i get the complete output in one block. What i'd anticipated was that in each loop, the flush() would somehow send that output to the client where it could be used, then the next loop's flush would send another output to the client... If i'm understanding it, Ajax is a single-request-single-response. i can't output the current step a process is in as it happens. i can accumulate them, as your model shows, and dump that out as a log, of sorts. But in order to monitor progress of one request's processing on the server, a series of follow-ups have to get feedback which the original is providing on the side (as T.J. recommended). Unless i'm missing something, which would be great if you could help me fill that in. :) -joe t. On Dec 11, 3:29 am, Alex McAuley webmas...@thecarmarketplace.com wrote: in your ajax request file ?php ini_set('output_buffering',0); // make sure the output_buffering directive is not set high ob_start(); // before anything is echoed to the screen for($i=0;$i10;$i++) { echo('liPrinting Line '.$i.'/li'); ob_flush(); flush(); sleep(1); // sleep for one second } ? this will output a line every second for 10 seconds Hope this helps P.S if you use ob_gz_handler this may not work (untested using it) Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: joe t. thooke...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Friday, December 11, 2009 1:00 AM Subject: [Proto-Scripty] Re: Progressive update messages from single request david: The buffer/flush path seems to be where this solution is heading. Don't ask me why, but iframes rub me the wrong way. With the evolving needs for more streamlined connections, iframes feel like soggy bandaids to me. Given they have a place where nothing else seems to work (Ajax-ish file uploads), but i'd prefer to steer away from them in this case if i can. TJ: That seems like a fairly solid idea. Same general concept of having a second request object checking in on progress that the server reports back, it just gets it from a relatively more reliable source (instead of $_SESSION). Alex: Could you elaborate a bit, or point me to where i can follow up on that? i'm intrigued, but i'm not deeply familiar with using the output buffer effectively. Thanks for the replies! -joe t. On Dec 10, 3:45 am, Alex McAuley webmas...@thecarmarketplace.com wrote: I noticed you were using PHP on the server side ... you can also use output buffering to achieve this in one request Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: T.J. Crowder t...@crowdersoftware.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Thursday, December 10, 2009 8:38 AM Subject: [Proto-Scripty] Re: Progressive update messages from single request Hi Joe, It seems to me the simple way to do this is have the first request initiate a process on the server that keeps running when the request completes; the request returns an indicator of the current status and an identifier for the action. Your subsequent requests supply the identifer, which allows the server- side page to check the progress of the ongoing work matching that ID and report back the (new) status. People use things like this for showing progress bars for file uploads without using Flash, that kind of thing. HTH, -- T.J. Crowder Independent Software Consultant tj / crowder software / comwww.crowdersoftware.com On Dec 9, 4:11 pm, joe t. thooke...@gmail.com wrote: i think i've seen examples of this, but can't recall where, and could use some guidance. Obviously it's easy to handle a 1:1 Request/Response How can i do a true 1:many process? For instance: Client takes a single action which requires the server to perform 3 tasks: * Query database * Generate PDF * Generate email, attach PDF, and send How can i respond to the client as EACH task is accomplished without ending the request chain? Looking up your data . . . (time-based dots as delay indicator) Creating PDF . . . Email sent (or failed, as the case may be) Is this done with HTTP 2xx headers? Recursive callbacks? If anyone can point me in the right direction (which include samples), i'd be grateful. Thanks.
Re: [Proto-Scripty] Re: document.write() vs Element/appendChild()
On samedi 12 décembre 2009, disccomp wrote: A good reason to get out of the habit of using document.write, is that it is NOT supported by XHTML.[1] [1] http://www.w3.org/MarkUp/2004/xhtml-faq#docwrite When using document.write() in XHTML documents, it clears the entire page and writes the new stuff on a blank page... -- Frédéric -- 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-scriptacul...@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: File output
Hi, No need to open a new window - if it starts downloading you'll be left with an empty window ;) Just do an HTTP call to the server and your original page will remain in the window if you have the correct headers going out from your PHP... David On Dec 11, 10:38 pm, bill will...@techservsys.com wrote: speedpac...@gmail.com wrote: he replied to my mail :p I guess we're all right this time - what a wonderful world it is ; I haven't replied at all, until now. On Dec 11, 4:08 pm, Alex McAuley webmas...@thecarmarketplace.com wrote: I'm not often wrong but i am right this time !!! I feel much better about not being able to do what I couldn't do. I guess I will open the last script in a new window and go from there. Thanks all. Alex is always right, as far as I know. -- Bill Drescher william {at} TechServSys {dot} com -- 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-scriptacul...@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.
Re: [Proto-Scripty] Re: File output
speedpac...@gmail.com wrote: Hi, No need to open a new window - if it starts downloading you'll be left with an empty window ;) Just do an HTTP call to the server and your original page will remain in the window if you have the correct headers going out from your PHP... Would you be so kind as to expand your suggestion, perhaps with a line of code ? David -- Bill Drescher william {at} TechServSys {dot} com -- 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-scriptacul...@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: Autocompleter does not work in FireFox 3.5.5
Just tossing in: Alternately, the script block that has the active part can be placed at the end of the document, so the DOM elements are loaded by the time the browser reaches that script tag. I've never been comfortable relying on that. I've heard people say it, some of them even people who seem like they know what they're doing, but I've never been comfortable *relying* on it. I really should find (or do) some really robust tests, probably a point of ignorance for me. Good catch that his script block *is* at the end. If you can count on elements being in place at that point, any idea why it's failing? -- T.J. On Dec 12, 2:00 am, joe t. thooke...@gmail.com wrote: Always makes me eager to jump in and spend my time helping. ;-) Nice. Just tossing in: Alternately, the script block that has the active part can be placed at the end of the document, so the DOM elements are loaded by the time the browser reaches that script tag. You knew that, but OP maybe didn't. -joe t. On Dec 11, 11:02 am, T.J. Crowder t...@crowdersoftware.com wrote: Hi, I have not really tried to debug this. Always makes me eager to jump in and spend my time helping. ;-) But the error is obvious enough in this case: You're trying to access the DOM from inline script, which won't work; the DOM doesn't exist when that script is executed. You need to use the window.load or dom:loaded event. document.observe('dom:loaded', function() { // Create the autocompleter }); HTH, -- T.J. Crowder Independent Software Consultant tj / crowder software / comwww.crowdersoftware.com On Dec 11, 3:10 pm, mjk mj.kelle...@gmail.com wrote: The error must be coming from another method that retrieves 'element'. I have not really tried to debug this. Wondering if anyone else has had this problem, and how they remedied it. The HTML html head meta http-equiv=Content-Type content=text/html; charset=utf-8/ script type=text/javascript src=http://localhost:4402/author/js/ prototype.js/script script type=text/javascript src=http://localhost:4402/author/js/ effects.js/script script type=text/javascript src=http://localhost:4402/author/js/ controls.js/script style type=text/css div.autocomplete { position:absolute; width:250px; background-color:white; border:1px solid #888; margin:0; padding:0;} div.autocomplete ul { list-style-type:none; margin:0; padding:0;} div.autocomplete ul li.selected { background-color: #ffb;} div.autocomplete ul li { list-style-type:none; display:block; margin:0; padding:2px; height:32px; cursor:pointer;} /style /head body label for=inputAutotext:/label input type=text id=input name=input size=15 / div id=results class=autocomplete style=display: none; position:relative;/div script type=text/javascript var txtid = 'input'; var divid = 'results'; var server = 'http://localhost:8080/ewcmtestbed/autocomplete'; new Ajax.Autocompleter(txtid, divid, server, { tokens: ','}); /script /body /html The error: In prototype.js element is null The method: cleanWhitespace: function(element) { element = $(element); var node = element.firstChild; while (node) { var nextNode = node.nextSibling; if (node.nodeType == 3 !/\S/.test(node.nodeValue)) element.removeChild(node); node = nextNode; } return element; }, -- 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-scriptacul...@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] Regarding selector engine in prototype.
Hai, i have some questions regarding the selector engine used in prototype. 1) what selector engine does prototype uses currently ? 2)is it better than selector engine like sizzle in jquery since when i compare drag and drop in jquery with prototype- scriptaculous, the jquery based one is very faster for 100 rows of tabular data. i just want to know whether its due to selector engine . -- 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-scriptacul...@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.
Re: [Proto-Scripty] Re: File output
speedpac...@gmail.com wrote: Hi, No need to open a new window - if it starts downloading you'll be left with an empty window ;) Just do an HTTP call to the server and your original page will remain in the window if you have the correct headers going out from your PHP... Interestingly enough, when I do a window.open() and the script just does a download, the window does not actually open, just the download dialog. No orphan window after that (in FireFox). David On Dec 11, 10:38 pm, bill will...@techservsys.com wrote: speedpac...@gmail.com wrote: he replied to my mail :p I guess we're all right this time - what a wonderful world it is ; I haven't replied at all, until now. On Dec 11, 4:08 pm, Alex McAuley webmas...@thecarmarketplace.com wrote: I'm not often wrong but i am right this time !!! I feel much better about not being able to do what I couldn't do. I guess I will open the last script in a new window and go from there. Thanks all. Alex is always right, as far as I know. -- Bill Drescher william {at} TechServSys {dot} com -- 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-scriptacul...@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. -- Bill Drescher william {at} TechServSys {dot} com -- 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-scriptacul...@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: Progressive update messages from single request
My crude-imentary tests are on my Win7 laptop using Wamp, which means mod_deflate. Work server is Cent, but i don't know whether it's got any compression modules enabled (i've tried with the admin, he slacks). -joe t. On Dec 12, 4:17 am, Alex McAuley webmas...@thecarmarketplace.com wrote: Joe. Are you using ob_gz_handler(); or mod_defalte / mod_gzip ? Also is it a winblows or *nix server Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: joe t. thooke...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Saturday, December 12, 2009 2:24 AM Subject: [Proto-Scripty] Re: Progressive update messages from single request Alex, Thanks for the sample. i must be missing a piece somewhere though...http://pastie.org/739926 From that single Ajax.Request, the client delays, and after the PHP is done running, i get the complete output in one block. What i'd anticipated was that in each loop, the flush() would somehow send that output to the client where it could be used, then the next loop's flush would send another output to the client... If i'm understanding it, Ajax is a single-request-single-response. i can't output the current step a process is in as it happens. i can accumulate them, as your model shows, and dump that out as a log, of sorts. But in order to monitor progress of one request's processing on the server, a series of follow-ups have to get feedback which the original is providing on the side (as T.J. recommended). Unless i'm missing something, which would be great if you could help me fill that in. :) -joe t. On Dec 11, 3:29 am, Alex McAuley webmas...@thecarmarketplace.com wrote: in your ajax request file ?php ini_set('output_buffering',0); // make sure the output_buffering directive is not set high ob_start(); // before anything is echoed to the screen for($i=0;$i10;$i++) { echo('liPrinting Line '.$i.'/li'); ob_flush(); flush(); sleep(1); // sleep for one second } ? this will output a line every second for 10 seconds Hope this helps P.S if you use ob_gz_handler this may not work (untested using it) Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: joe t. thooke...@gmail.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Friday, December 11, 2009 1:00 AM Subject: [Proto-Scripty] Re: Progressive update messages from single request david: The buffer/flush path seems to be where this solution is heading. Don't ask me why, but iframes rub me the wrong way. With the evolving needs for more streamlined connections, iframes feel like soggy bandaids to me. Given they have a place where nothing else seems to work (Ajax-ish file uploads), but i'd prefer to steer away from them in this case if i can. TJ: That seems like a fairly solid idea. Same general concept of having a second request object checking in on progress that the server reports back, it just gets it from a relatively more reliable source (instead of $_SESSION). Alex: Could you elaborate a bit, or point me to where i can follow up on that? i'm intrigued, but i'm not deeply familiar with using the output buffer effectively. Thanks for the replies! -joe t. On Dec 10, 3:45 am, Alex McAuley webmas...@thecarmarketplace.com wrote: I noticed you were using PHP on the server side ... you can also use output buffering to achieve this in one request Alex Mcauleyhttp://www.thevacancymarket.com - Original Message - From: T.J. Crowder t...@crowdersoftware.com To: Prototype script.aculo.us prototype-scriptaculous@googlegroups.com Sent: Thursday, December 10, 2009 8:38 AM Subject: [Proto-Scripty] Re: Progressive update messages from single request Hi Joe, It seems to me the simple way to do this is have the first request initiate a process on the server that keeps running when the request completes; the request returns an indicator of the current status and an identifier for the action. Your subsequent requests supply the identifer, which allows the server- side page to check the progress of the ongoing work matching that ID and report back the (new) status. People use things like this for showing progress bars for file uploads without using Flash, that kind of thing. HTH, -- T.J. Crowder Independent Software Consultant tj / crowder software / comwww.crowdersoftware.com On Dec 9, 4:11 pm, joe t. thooke...@gmail.com wrote: i think i've seen examples of this, but can't recall where, and could use some guidance. Obviously it's easy to handle a 1:1 Request/Response How can i do a true 1:many process? For instance: Client takes a single action which requires the server to perform 3 tasks: * Query database * Generate PDF * Generate email, attach PDF, and send How can i
[Proto-Scripty] Re: Autocompleter does not work in FireFox 3.5.5
U, right, sure, yeah, of COURSE i saw that... (didn't). i tend to agree with you on [not] placing the active script block at the end of the document and trusting it to work 100% of the time. Like you, i haven't seen any hard data on why NOT to, but just don't fully trust it. i don't see any obvious reason the script would be failing. Tracing back #clearWhitespace from Prototype, it only occurs in Autocompleter in the #onComplete callback. i don't use the class that much, so i'm not the best one to ask. i just happened across your initial response in my digest email. :O Sorry i couldn't be more help on this one. -joe t. On Dec 12, 6:05 am, T.J. Crowder t...@crowdersoftware.com wrote: Just tossing in: Alternately, the script block that has the active part can be placed at the end of the document, so the DOM elements are loaded by the time the browser reaches that script tag. I've never been comfortable relying on that. I've heard people say it, some of them even people who seem like they know what they're doing, but I've never been comfortable *relying* on it. I really should find (or do) some really robust tests, probably a point of ignorance for me. Good catch that his script block *is* at the end. If you can count on elements being in place at that point, any idea why it's failing? -- T.J. On Dec 12, 2:00 am, joe t. thooke...@gmail.com wrote: Always makes me eager to jump in and spend my time helping. ;-) Nice. Just tossing in: Alternately, the script block that has the active part can be placed at the end of the document, so the DOM elements are loaded by the time the browser reaches that script tag. You knew that, but OP maybe didn't. -joe t. On Dec 11, 11:02 am, T.J. Crowder t...@crowdersoftware.com wrote: Hi, I have not really tried to debug this. Always makes me eager to jump in and spend my time helping. ;-) But the error is obvious enough in this case: You're trying to access the DOM from inline script, which won't work; the DOM doesn't exist when that script is executed. You need to use the window.load or dom:loaded event. document.observe('dom:loaded', function() { // Create the autocompleter }); HTH, -- T.J. Crowder Independent Software Consultant tj / crowder software / comwww.crowdersoftware.com On Dec 11, 3:10 pm, mjk mj.kelle...@gmail.com wrote: The error must be coming from another method that retrieves 'element'. I have not really tried to debug this. Wondering if anyone else has had this problem, and how they remedied it. The HTML html head meta http-equiv=Content-Type content=text/html; charset=utf-8/ script type=text/javascript src=http://localhost:4402/author/js/ prototype.js/script script type=text/javascript src=http://localhost:4402/author/js/ effects.js/script script type=text/javascript src=http://localhost:4402/author/js/ controls.js/script style type=text/css div.autocomplete { position:absolute; width:250px; background-color:white; border:1px solid #888; margin:0; padding:0;} div.autocomplete ul { list-style-type:none; margin:0; padding:0;} div.autocomplete ul li.selected { background-color: #ffb;} div.autocomplete ul li { list-style-type:none; display:block; margin:0; padding:2px; height:32px; cursor:pointer;} /style /head body label for=inputAutotext:/label input type=text id=input name=input size=15 / div id=results class=autocomplete style=display: none; position:relative;/div script type=text/javascript var txtid = 'input'; var divid = 'results'; var server = 'http://localhost:8080/ewcmtestbed/autocomplete'; new Ajax.Autocompleter(txtid, divid, server, { tokens: ','}); /script /body /html The error: In prototype.js element is null The method: cleanWhitespace: function(element) { element = $(element); var node = element.firstChild; while (node) { var nextNode = node.nextSibling; if (node.nodeType == 3 !/\S/.test(node.nodeValue)) element.removeChild(node); node = nextNode; } return element; }, -- 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-scriptacul...@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.