<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tips for Twits &#187; javascript</title>
	<atom:link href="http://t.wits.sg/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://t.wits.sg</link>
	<description>WARNING: excessive use of this site will increase MP at the expense of HP</description>
	<lastBuildDate>Mon, 16 Aug 2010 04:09:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Google Maps Helper</title>
		<link>http://t.wits.sg/2009/06/14/google-maps-helper/</link>
		<comments>http://t.wits.sg/2009/06/14/google-maps-helper/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 13:51:15 +0000</pubDate>
		<dc:creator>gaweee</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[frontend]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[maps]]></category>

		<guid isPermaLink="false">http://t.wits.sg/?p=281</guid>
		<description><![CDATA[In our work we like to create Google Maps links for our client&#8217;s (offices, stores, etc). However, the larger our clients presence, the more random links there are bound to be. When it comes to using Google Map&#8217;s javascript API to control the map, thats still perfectly fine. But how do I create a google [...]]]></description>
			<content:encoded><![CDATA[<p>In our work we like to create Google Maps links for our client&#8217;s (offices, stores, etc). However, the larger our clients presence, the more random links there are bound to be. When it comes to using Google Map&#8217;s javascript API to control the map, thats still perfectly fine. But how do I create a google maps link that only shows 1 entry? Turns out, there are several ways to do this:</p>
<ol>
<li><strong>Manipulate the request such that it only shows your entry</strong>How? For example, searching for &#8220;Holland, Singapore&#8221; will lead us to about 1,356 results. See <a href="http://www.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=holland,+Singapore&amp;mrt=yp&amp;sll=1.305855,103.786876&amp;sspn=0.008055,0.016522&amp;ie=UTF8&amp;z=14">here</a>. So lets tweak it a little:
<ul>
<li>Append <code>&amp;mrt=yp</code> to the url &#8211; That returns us all the business listings. (852 results)</li>
<li>Append <code>&amp;start=16</code> to the url &#8211; That skips the first 16 results (Shows results 17-26 of 852)</li>
<li>Append <code>&amp;num=2</code> to the url &#8211; That returns us only 2 results (Only shows 2 results)</li>
</ul>
<p>For a more complete listing of Google Maps Parameters, consult <a href="http://mapki.com/wiki/Google_Map_Parameters">mapki.com</a>. Kudos to those guys for compiling that list. Really useful stuff<br />
So there you have it, a simple way to link your business such that its the only entry there. However this method is relatively dangerous. Why? Cause you&#8217;ve got no idea of the exact ordering that Google maps may return. Today you could be entry 17, surely not in a year (hopefully for the better). As such, this is not the recommended solution.</li>
<li><strong>Use the address with your long/lat coordinates to generate your entry.</strong>
<ul>
<li> First get your GPS coordinates, there are a number of ways to do this. Check our this <a href="http://en.wikipedia.org/wiki/Geographic_coordinates_(obtaining)">link</a></li>
<li>Then create your link via the following structure: <code>http://www.google.com/maps?&amp;ie=UTF8&amp;hl=en&amp;q=[urlescaped address]&amp;ll=[GPS lat,long]&amp;z=[Zoom]&amp;iwloc=A</code></li>
<li>Still too troublesome? We&#8217;ve created a simple tool for our clients to use. Save yourself some time.  <a href="http://t.wits.sg/misc/googleMapsHelper/demo.php">Try it!</a>
</li>
<p>Done! Whats the downside to this? <strong>You can only show the address for the business</strong>. Because searching by business names returns us way too many results. So instead, we have to search for an address, Google interprets this as an address and only returns 1 result (which is the whole point of geocoding). At this point its easy to the map to what we need. We&#8217;d use this typically for this nifty little &#8220;Find us on a map&#8221; links (instead of embedding the actual map on your site).</ul>
</li>
</ol>
<p>Once again, if you&#8217;d rather embed Google maps directly into your site via the JS, then your options are much more open.<br />
Good luck! Let us know if it works for you, of if you find a better way of doing things!<br />
<a href="http://t.wits.sg/misc/googleMapsHelper/demo.php"><img src="http://t.wits.sg/wp-content/uploads/2009/06/googleMapsHelper-300x291.png" alt="googleMapsHelper" title="googleMapsHelper" width="300" height="291" class="alignnone size-medium wp-image-314" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://t.wits.sg/2009/06/14/google-maps-helper/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HOWTO: Readymade Form CSS and Highlighting</title>
		<link>http://t.wits.sg/2009/02/08/howto-readymade-form-css-and-highlighting/</link>
		<comments>http://t.wits.sg/2009/02/08/howto-readymade-form-css-and-highlighting/#comments</comments>
		<pubDate>Sun, 08 Feb 2009 19:48:59 +0000</pubDate>
		<dc:creator>gaweee</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[frontend]]></category>
		<category><![CDATA[highlighting]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://t.wits.sg/?p=25</guid>
		<description><![CDATA[We&#8217;ve been working on web development for awhile now, i&#8217;ve really only seen a handful of pretty forms. The interfaces seen at Uni-Form, mooflex and even to a certain extent linuxjournal are all intuitive and well thought out. So in the good ol WITS culture, we&#8217;ve tried our hand at building our own version of [...]]]></description>
			<content:encoded><![CDATA[<div style="float: left; margin: 0px 10px 10px 0px;"><a href="http://t.wits.sg/wp-content/uploads/2009/02/jquerywitsform.jpg"><img class="alignleft size-medium wp-image-26" title="jquerywitsform" src="http://t.wits.sg/wp-content/uploads/2009/02/jquerywitsform.jpg" alt="jQuery WITSForm" width="200" height="200" /></a></div>
<p>We&#8217;ve been working on web development for awhile now, i&#8217;ve really only seen a handful of pretty forms. The interfaces seen at <a href="http://www.sprawsm.com/uni-form/" target="_blank">Uni-Form</a>, <a href="http://www.mooflex.net" target="_blank">mooflex</a> and even to a certain extent <a href="http://www.linuxjournal.com" target="_blank">linuxjournal</a> are all intuitive and well thought out.</p>
<p>So in the good ol WITS culture, we&#8217;ve tried our hand at building our own version of a universal form interface. Alot of features were borrowed off work already done at <a href="http://www.sprawsm.com/uni-form/" target="_blank">Uni-Form</a>. We just made it jQueried, lighter and more readable. Like all other jQuery plugins, insert jquery.js, insert the jquery.witsform.js script, insert the css, use the right html code, and you&#8217;re done! I&#8217;m pretty sure as time goes by i&#8217;ll keep improving it. So here&#8217;s version 1.0 meanwhile. We bothered so that you shouldnt have to.</p>
<p><strong>download the jQuery WITSForm here: <a href="http://t.wits.sg/downloads/jquery.witsform.1.0.zip" target="_blank">jQuery WITSForm</a><br />
or view the demo <a href="http://t.wits.sg/misc/jQueryWITSForm/demo.php" target="_blank">here</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://t.wits.sg/2009/02/08/howto-readymade-form-css-and-highlighting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HOWTO: PHP and jQuery upload progress bar</title>
		<link>http://t.wits.sg/2008/06/25/howto-php-and-jquery-upload-progress-bar/</link>
		<comments>http://t.wits.sg/2008/06/25/howto-php-and-jquery-upload-progress-bar/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 09:09:18 +0000</pubDate>
		<dc:creator>gaweee</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[backend]]></category>
		<category><![CDATA[frontend]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[progressbar]]></category>

		<guid isPermaLink="false">http://t.wits.sg/?p=16</guid>
		<description><![CDATA[With the controllable jQuery Progress Bar, writing a form upload progress bar seems like a piece of cake now. Hypothetically, all we need is to create the bar, poll for the progress of the file upload, derive the new progress bar value (in percentage) and set it. To do that you need to prepare the [...]]]></description>
			<content:encoded><![CDATA[<p>With the controllable jQuery Progress Bar, writing a form upload progress bar seems like a piece of cake now. Hypothetically, all we need is to create the bar, poll for the progress of the file upload, derive the new progress bar value (in percentage) and set it.</p>
<p>To do that you need to prepare the php script to do it. By default PHP cant report the progress of upload progress. However people smarter than me have already solved that problem. In 5 mins i&#8217;ve found 2 solutions: the <a href="http://pecl.php.net/apc" target="_blank">Alternative PHP Cache (APC)</a> method as well as the <a href="http://pecl.php.net/package/uploadprogress" target="_blank">UploadProgress </a>method. Both of them are PECL packages. Because i couldnt get APC to work on my server properly, i&#8217;ll document the UploadProgress more in detail here&#8230;</p>
<div class="contenblock"><strong>Step 1: Install the uploadprogress package. </strong>Really simple just run the following command  </p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">pecl install uploadprogress</pre></div></div>

<p>Once that is done, register the extension to your PHP with the following line in your php.ini</p>

<div class="wp_syntax"><div class="code"><pre class="language" style="font-family:monospace;">extension=uploadprogress.so</pre></div></div>

<p>then restart your apache/httpd</p>
</div>
<div class="contentblock"><strong>Step 2: Create the form and your progress bar</strong>  </p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>form id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;uploadform&quot;</span> enctype<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;multipart/form-data&quot;</span> method<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;post&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>input id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;progress_key&quot;</span> <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;UPLOAD_IDENTIFIER&quot;</span> type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;hidden&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;&amp;lt;?= $uuid ?&amp;gt;&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>input id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;ulfile&quot;</span> <span style="color: #000066;">name</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;ulfile&quot;</span> type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;file&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;</span>input type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;submit&quot;</span> value<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;Upload&quot;</span> <span style="color: #339933;">/&gt;</span>
	<span style="color: #339933;">&lt;</span>span id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;uploadprogressbar&quot;</span> <span style="color: #003366; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;progressbar&quot;</span><span style="color: #339933;">&gt;</span><span style="color: #CC0000;">0</span><span style="color: #339933;">%&lt;/</span>span<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>form<span style="color: #339933;">&gt;</span></pre></div></div>

<p>this creates the form with a file field as well as a unique UPLOAD_IDENTIFIER hidden field that allows our script to check the progress of the form submission.</p>
</div>
<div class="contentblock"><strong>Step 3: Next the script itself to check the respond with the progress of the form submission.</strong> Lets call this file <em>uploadprogress.php</em>  </p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Cache-Control: no-cache, must-revalidate&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Expires: Mon, 26 Jul 1997 05:00:00 GMT&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">echo</span> <span style="color: #990000;">json_encode</span><span style="color: #009900;">&#40;</span>uploadprogress_get_info<span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The header no-cache declarations circumvents IE&#8217;s cache of the response. Basically this form does nothing but respond with a json encoded string of the uploadprogress_get_info function. The id argument is the same one we used in the form. Think of it as a form-upload-process-id. A typical response looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#123;</span><span style="color: #3366CC;">&quot;time_start&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;1214384364&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;time_last&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;1214384366&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;speed_average&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;25889&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;speed_last&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;40952&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;bytes_uploaded&quot;</span> <span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;51778&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;bytes_total&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;8125518&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;files_uploaded&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;0&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;est_sec&quot;</span><span style="color: #339933;">:</span><span style="color: #3366CC;">&quot;311&quot;</span><span style="color: #009900;">&#125;</span></pre></div></div>

<p>the response encodes a good deal of data about the form submission. most importantly for us: <em>bytes_uploaded</em> and <em>bytes_total</em></p>
</div>
<div class="contentblock"><strong>Step 3: use jQuery and a timer to keep polling the page and update the progress bar value</strong>  </p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> progress_key <span style="color: #339933;">=</span> <span style="color: #3366CC;">''</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// this sets up the progress bar</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#uploadprogressbar&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">progressBar</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// fades in the progress bar and starts polling the upload progress after 1.5seconds</span>
<span style="color: #003366; font-weight: bold;">function</span> beginUpload<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#uploadprogressbar&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fadeIn</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	setTimeout<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;showUpload()&quot;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1500</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// uses ajax to poll the uploadprogress.php page with the id</span>
<span style="color: #006600; font-style: italic;">// deserializes the json string, and computes the percentage (integer)</span>
<span style="color: #006600; font-style: italic;">// update the jQuery progress bar</span>
<span style="color: #006600; font-style: italic;">// sets a timer for the next poll in 750ms</span>
<span style="color: #003366; font-weight: bold;">function</span> showUpload<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	$.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;uploadprogress.php?id=&quot;</span> <span style="color: #339933;">+</span> progress_key<span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>data<span style="color: #009900;">&#41;</span>
			<span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #003366; font-weight: bold;">var</span> response<span style="color: #339933;">;</span>
		<span style="color: #000066; font-weight: bold;">eval</span> <span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;response = &quot;</span> <span style="color: #339933;">+</span> data<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>response<span style="color: #009900;">&#41;</span>
			<span style="color: #000066; font-weight: bold;">return</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #003366; font-weight: bold;">var</span> percentage <span style="color: #339933;">=</span> Math.<span style="color: #660066;">floor</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">100</span> <span style="color: #339933;">*</span> parseInt<span style="color: #009900;">&#40;</span>response<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'bytes_uploaded'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> parseInt<span style="color: #009900;">&#40;</span>response<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'bytes_total'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;#uploadprogressbar&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">progressBar</span><span style="color: #009900;">&#40;</span>percentage<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	setTimeout<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;showUpload()&quot;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">750</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>viola! read the comments if you dont understand the code. it is _THAT_ straightforward. Of course there can be many improvements such as stopping the script when the upload reaches 100% but thats probably not really needed since the whole page is refreshed. But this approach allows the flexibility of ajax submissions and what nots.</p>
<p><strong>Again, download the jQuery progressbar here: <a href="http://t.wits.sg/jquery-progress-bar/" target="_blank">jQuery progressbar</a><br />
or view the demo <a href="http://t.wits.sg/misc/jQueryProgressBar/demo.php" target="_blank">here</a></strong></p>
</div>
<div class="contentblock" style="padding-top: 15px; border-top: 1px dashed #ddd;"><strong>Note:</strong> for the APC solution seekers out there, assuming you can get APC to work, the solution is not so different. A few changes will get your there:  </p>
<ul>
<li>Change the HTML hidden form field name from <em>UPLOAD_IDENTIFIER</em> to <em>APC_UPLOAD_PROGRESS</em></li>
<li>Change the PHP <em>uploadprogress_get_info($_GET['id'])</em> to <em>apc_fetch(&#8216;upload_&#8217;.$_GET['id']));</em></li>
<li>Change the Javascript percentage calculation from:<br />
<em>Math.floor(100 * parseInt(response['bytes_uploaded']) / parseInt(response['bytes_total']));</em><br />
to:<br />
<em>Math.floor(100 * parseInt(response['current']) / parseInt(response['total']));</em></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://t.wits.sg/2008/06/25/howto-php-and-jquery-upload-progress-bar/feed/</wfw:commentRss>
		<slash:comments>48</slash:comments>
		</item>
	</channel>
</rss>
