<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: AJAX progress bar</title>
	<atom:link href="http://www.redips.net/javascript/ajax-progress-bar/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.redips.net/javascript/ajax-progress-bar/</link>
	<description>Techniques and Web Technologies</description>
	<lastBuildDate>Sat, 04 Feb 2012 16:29:46 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/</generator>
	<item>
		<title>By: netrevoltech</title>
		<link>http://www.redips.net/javascript/ajax-progress-bar/comment-page-3/#comment-4906</link>
		<dc:creator>netrevoltech</dc:creator>
		<pubDate>Tue, 10 Jan 2012 17:30:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.redips.net/?p=67#comment-4906</guid>
		<description>@dbunic Your solution is exactly what I was thinking of. Its easy to store the progress in database and then send a request to some different page for fetching the progress value from DB with some interval and with a status flag to indicate when to stop sending Ajax request.</description>
		<content:encoded><![CDATA[<p>@dbunic Your solution is exactly what I was thinking of. Its easy to store the progress in database and then send a request to some different page for fetching the progress value from DB with some interval and with a status flag to indicate when to stop sending Ajax request.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Godly Mathew</title>
		<link>http://www.redips.net/javascript/ajax-progress-bar/comment-page-3/#comment-4463</link>
		<dc:creator>Godly Mathew</dc:creator>
		<pubDate>Mon, 19 Sep 2011 06:40:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.redips.net/?p=67#comment-4463</guid>
		<description>@ARA: You can communicate with asp through ajax.

you can use response.write function.

eg : response.write(&quot;100&quot;)</description>
		<content:encoded><![CDATA[<p>@ARA: You can communicate with asp through ajax.</p>
<p>you can use response.write function.</p>
<p>eg : response.write("100")</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dbunic</title>
		<link>http://www.redips.net/javascript/ajax-progress-bar/comment-page-3/#comment-4270</link>
		<dc:creator>dbunic</dc:creator>
		<pubDate>Tue, 02 Aug 2011 10:03:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.redips.net/?p=67#comment-4270</guid>
		<description>@Andy - I&#039;m not sure or even it&#039;s not possible to make direct communication between two browsers. But it&#039;s possible indirectly. First page should somehow save job progress  to the server and other instances should query for percentage. Actually, if you open two browser instances with this demo, both progress bars will show the same value. I know this answer comes late, but hopefully will be helpful to others.

@ARA - I&#039;m sorry, but my ASP skills are very thin so I can help you with server side only on conceptual level. If you want to create progress bar for database activity, my advice is to split database insert to several steps (simply create loop) . First make one insert with value 0 to the temporary table. When database insert starts, after every 200 inserted rows, update value in temporary table by 1. So, in case of 20,000 rows you will actually get job percentage completion. Now is easy to implement simple service to read updated value from database and return it as XML to the JavaScript progress bar. Hope this tip will give you an idea of how to create progress bar for adding record to the database.</description>
		<content:encoded><![CDATA[<p>@Andy - I'm not sure or even it's not possible to make direct communication between two browsers. But it's possible indirectly. First page should somehow save job progress  to the server and other instances should query for percentage. Actually, if you open two browser instances with this demo, both progress bars will show the same value. I know this answer comes late, but hopefully will be helpful to others.</p>
<p>@ARA - I'm sorry, but my ASP skills are very thin so I can help you with server side only on conceptual level. If you want to create progress bar for database activity, my advice is to split database insert to several steps (simply create loop) . First make one insert with value 0 to the temporary table. When database insert starts, after every 200 inserted rows, update value in temporary table by 1. So, in case of 20,000 rows you will actually get job percentage completion. Now is easy to implement simple service to read updated value from database and return it as XML to the JavaScript progress bar. Hope this tip will give you an idea of how to create progress bar for adding record to the database.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ARA</title>
		<link>http://www.redips.net/javascript/ajax-progress-bar/comment-page-3/#comment-4263</link>
		<dc:creator>ARA</dc:creator>
		<pubDate>Mon, 01 Aug 2011 17:08:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.redips.net/?p=67#comment-4263</guid>
		<description>I would like to implement progress bar in classic asp. The progress bar will be included to indicate adding record to the database. A user can upload a file with up to 20,000 records. I would like to use this using classic asp. Any chance you can include demo code in asp?</description>
		<content:encoded><![CDATA[<p>I would like to implement progress bar in classic asp. The progress bar will be included to indicate adding record to the database. A user can upload a file with up to 20,000 records. I would like to use this using classic asp. Any chance you can include demo code in asp?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy</title>
		<link>http://www.redips.net/javascript/ajax-progress-bar/comment-page-3/#comment-3768</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Sat, 16 Apr 2011 04:48:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.redips.net/?p=67#comment-3768</guid>
		<description>Is there a way to get the % finished from another script that is running?  I have the page start a big script via xmlhttprequest (and I have a variable in that script defined as to what % it&#039;s at), then can I use a 2nd instance of the xmlhttprequest (maybe to another script) to get the percent from the first script somehow?</description>
		<content:encoded><![CDATA[<p>Is there a way to get the % finished from another script that is running?  I have the page start a big script via xmlhttprequest (and I have a variable in that script defined as to what % it's at), then can I use a 2nd instance of the xmlhttprequest (maybe to another script) to get the percent from the first script somehow?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gamezat</title>
		<link>http://www.redips.net/javascript/ajax-progress-bar/comment-page-3/#comment-3670</link>
		<dc:creator>gamezat</dc:creator>
		<pubDate>Mon, 14 Mar 2011 10:10:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.redips.net/?p=67#comment-3670</guid>
		<description>thank you it&#039;s nice 
i will install it to server to server script 
thank you</description>
		<content:encoded><![CDATA[<p>thank you it's nice<br />
i will install it to server to server script<br />
thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dbunic</title>
		<link>http://www.redips.net/javascript/ajax-progress-bar/comment-page-3/#comment-3644</link>
		<dc:creator>dbunic</dc:creator>
		<pubDate>Wed, 09 Mar 2011 11:03:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.redips.net/?p=67#comment-3644</guid>
		<description>@Sunny - Please, can you give me more details about a problem you mention. Actually, I made tests with Google Chrome 10.0.648.127, FireFox 3.6.10 and IE8 8.0.6001.18702 and in all browsers AJAX progress bar works. Unfortunately I don&#039;t have Safari browser to confirm. This demo requests &lt;a href=&quot;/my/ajax-progress-bar.php&quot; title=&quot;XML response&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;ajax-progress-bar.php&lt;/a&gt; every second and displays fetched progress value. Maybe you have some network problem (I&#039;m not kidding) ... I noticed that my other IE8 launched in virtual machine have similar issues. Can you manually access progress-bar.php and test received XML document? Next, try to reload that page and see how progress value is changing. You can also start DOM inspector, choose Network card and click &quot;Start&quot; button. AJAX JavaScript code will send requests and you should see each request line in inspector tool.

Hope this tips will help you to find and solve the problem.
Cheers!</description>
		<content:encoded><![CDATA[<p>@Sunny - Please, can you give me more details about a problem you mention. Actually, I made tests with Google Chrome 10.0.648.127, FireFox 3.6.10 and IE8 8.0.6001.18702 and in all browsers AJAX progress bar works. Unfortunately I don't have Safari browser to confirm. This demo requests <a href="/my/ajax-progress-bar.php" title="XML response" target="_blank" rel="nofollow">ajax-progress-bar.php</a> every second and displays fetched progress value. Maybe you have some network problem (I'm not kidding) ... I noticed that my other IE8 launched in virtual machine have similar issues. Can you manually access progress-bar.php and test received XML document? Next, try to reload that page and see how progress value is changing. You can also start DOM inspector, choose Network card and click "Start" button. AJAX JavaScript code will send requests and you should see each request line in inspector tool.</p>
<p>Hope this tips will help you to find and solve the problem.<br />
Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sunny</title>
		<link>http://www.redips.net/javascript/ajax-progress-bar/comment-page-2/#comment-3643</link>
		<dc:creator>Sunny</dc:creator>
		<pubDate>Wed, 09 Mar 2011 09:52:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.redips.net/?p=67#comment-3643</guid>
		<description>Not working in safari and chrome ????</description>
		<content:encoded><![CDATA[<p>Not working in safari and chrome ????</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dbunic</title>
		<link>http://www.redips.net/javascript/ajax-progress-bar/comment-page-2/#comment-3332</link>
		<dc:creator>dbunic</dc:creator>
		<pubDate>Thu, 10 Feb 2011 17:18:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.redips.net/?p=67#comment-3332</guid>
		<description>@Shawn - So, you started some job from browser and want to follow progress of execution. That&#039;s fine, but don&#039;t forget that HTTP is stateless protocol. In other words, HTTP server will imply every AJAX request as separated request. OK, imagine your CGI processes heavy job you want to monitor. When a new AJAX request comes to the HTTP server, a single control process of HTTPD (the parent) will transfer that request to the first free child process. So, a new CGI process will get AJAX request - not the previous one that still executes heavy task.

If you can somehow read the progress of job execution with separate CGI, that should be the solution for your problem.

I will give you another scenario for monitoring 10000 inserts to the MySQL database. First I have to be sure that execution time will not be longer then PHP limit (or I will have to increase &lt;em&gt;max_execution_time&lt;/em&gt; parameter in /etc/php.ini file). Next, after every 100 inserts in table &quot;A&quot;, I will update counter in the same MySQL database (for example &quot;counter&quot; row in my &quot;progress&quot; table). AJAX progress bar will be directed to read the &quot;counter&quot; row from &quot;progress&quot; table and display it to the user interface. With this solution, I will be able to monitor MySQL insert progress ...

Hope this comment will give you some hints and directions.
Cheers!</description>
		<content:encoded><![CDATA[<p>@Shawn - So, you started some job from browser and want to follow progress of execution. That's fine, but don't forget that HTTP is stateless protocol. In other words, HTTP server will imply every AJAX request as separated request. OK, imagine your CGI processes heavy job you want to monitor. When a new AJAX request comes to the HTTP server, a single control process of HTTPD (the parent) will transfer that request to the first free child process. So, a new CGI process will get AJAX request - not the previous one that still executes heavy task.</p>
<p>If you can somehow read the progress of job execution with separate CGI, that should be the solution for your problem.</p>
<p>I will give you another scenario for monitoring 10000 inserts to the MySQL database. First I have to be sure that execution time will not be longer then PHP limit (or I will have to increase <em>max_execution_time</em> parameter in /etc/php.ini file). Next, after every 100 inserts in table "A", I will update counter in the same MySQL database (for example "counter" row in my "progress" table). AJAX progress bar will be directed to read the "counter" row from "progress" table and display it to the user interface. With this solution, I will be able to monitor MySQL insert progress ...</p>
<p>Hope this comment will give you some hints and directions.<br />
Cheers!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shawn</title>
		<link>http://www.redips.net/javascript/ajax-progress-bar/comment-page-2/#comment-3299</link>
		<dc:creator>Shawn</dc:creator>
		<pubDate>Tue, 08 Feb 2011 21:36:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.redips.net/?p=67#comment-3299</guid>
		<description>When I run this script, it loads another instance of my CGI program every second as opposed to getting the status of the already running program. 

What am I doing wrong?
My CGI is just returning STDOUT text.
my request_handler looks like this:

&lt;pre class=&quot;brush: js&quot;&gt;
function request_handler() {
    var r = &quot;&quot;;
    if (request.readyState === 4) {   // if state = 4 (operation is completed)
        if (request.status === 200) { // and the HTTP status is OK
            r = request.responseText;
            delayWrite(r);
        } else { // if request status isn&#039;t OK
            r = request.responseText;
            delayWrite(r);
        }
    }
}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>When I run this script, it loads another instance of my CGI program every second as opposed to getting the status of the already running program. </p>
<p>What am I doing wrong?<br />
My CGI is just returning STDOUT text.<br />
my request_handler looks like this:</p>
<pre class="brush: js">
function request_handler() {
    var r = "";
    if (request.readyState === 4) {   // if state = 4 (operation is completed)
        if (request.status === 200) { // and the HTTP status is OK
            r = request.responseText;
            delayWrite(r);
        } else { // if request status isn't OK
            r = request.responseText;
            delayWrite(r);
        }
    }
}
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>

