<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Disqus - Latest Comments for imwoodie</title><link>http://disqus.com/by/imwoodie/</link><description></description><atom:link href="http://disqus.com/imwoodie/comments.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Sat, 12 Sep 2009 21:23:08 -0000</lastBuildDate><item><title>Re: PHP jQuery AJAX Javascript Long Polling</title><link>http://www.perplexedlabs.com/2009/05/04/php-jquery-ajax-javascript-long-polling/#comment-16522507</link><description>&lt;p&gt;thanks for correction in memcache matt, great..&lt;/p&gt;&lt;p&gt;sorry, the code above was alert(bidid) not alert('bidid');&lt;br&gt;the alert box is displayed well with returned data from xml&lt;br&gt;it works in all browser except in I.E all version&lt;br&gt;in I.E the alert box is not displayed.. that's the problem&lt;/p&gt;&lt;p&gt;Well anyway I just have find the way to make it works in IE&lt;br&gt;I changes the lpStart function as follow:&lt;/p&gt;&lt;p&gt;&lt;code&gt;&lt;br&gt;	var lpStart = function() {&lt;br&gt;		$.ajax({&lt;br&gt;			type: "POST",&lt;br&gt;			cache: false,&lt;br&gt;			url: "proc.php",&lt;br&gt;			success: lpOnComplete&lt;br&gt;		});&lt;br&gt;	};&lt;br&gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;as u suggest for the memcache in proc.php i put this following code.. &lt;br&gt;&lt;code&gt;&lt;br&gt;&lt;br&gt;		  &amp;lt;data&amp;gt;" . memcache_get($memcache_obj, 'bid') . "&amp;lt;/data&amp;gt;";  &lt;br&gt;&lt;br&gt;	// data is always new&lt;br&gt;	if(!empty($data)){&lt;br&gt;		Header("Content-Type: text/xml");&lt;br&gt;		flush();&lt;br&gt;		usleep(1000000);&lt;br&gt;		echo $data;&lt;br&gt;		break;&lt;br&gt;	}&lt;br&gt;}&lt;br&gt;?&amp;gt;&lt;br&gt;&lt;/code&gt;&lt;/p&gt;&lt;p&gt;it's using 2 thread on apache with keep alive connection, better than using setTimeout or setInterval, which use 60 thread for every second retrieving new data.&lt;/p&gt;&lt;p&gt;I hope it help the other who get the problem in IE.. this browser always make me work twice.. &lt;br&gt;Thank you matt.. much appreciated.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">imwoodie</dc:creator><pubDate>Sat, 12 Sep 2009 21:23:08 -0000</pubDate></item><item><title>Re: PHP jQuery AJAX Javascript Long Polling</title><link>http://www.perplexedlabs.com/2009/05/04/php-jquery-ajax-javascript-long-polling/#comment-16502160</link><description>&lt;p&gt;thanks for reply matt.. appreciate.&lt;/p&gt;&lt;p&gt;well there's no error code in I.E, I'm not using jason but xml as a data..&lt;br&gt;here are code that I try to implement :&lt;/p&gt;&lt;p&gt;&lt;code&gt;&lt;br&gt;&amp;lt;script src="jquery-1.3.2.min.js" type="text/javascript"&amp;gt;&amp;lt;/script&amp;gt;&lt;br&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br&gt;	var lpOnComplete = function(response) {&lt;br&gt;		$(response).find('id').each(function(){&lt;br&gt;			var id = $(this); &lt;br&gt;			bidid = id.attr("id");&lt;br&gt;			alert('bidid');&lt;br&gt;		// do more processing&lt;br&gt;		});&lt;br&gt;		&lt;br&gt;		lpStart();&lt;br&gt;	};&lt;br&gt;	&lt;br&gt;	var lpStart = function() {&lt;br&gt;		//$.ajaxSetup({ cache: false });&lt;br&gt;		$.get('proc.php',  { }, lpOnComplete, 'XML');&lt;br&gt;	};&lt;br&gt;	&lt;br&gt;	$(document).ready(lpStart);&lt;br&gt;&amp;lt;/script&amp;gt;&lt;br&gt;&lt;code&gt;&lt;br&gt;&lt;br&gt;This is &lt;em&gt;proc.php&lt;/em&gt;, I'm using memcache&lt;br&gt;&lt;br&gt;&lt;code&gt;&lt;br&gt;&lt;br&gt;		  &amp;lt;data&amp;gt;" . memcache_get($memcache_obj, 'bid') . "&amp;lt;/data&amp;gt;"; &lt;br&gt;&lt;br&gt;	// data is always new&lt;br&gt;	if(!empty($data)) {&lt;br&gt;		Header("Content-Type: text/xml");&lt;br&gt;		echo $data;&lt;br&gt;		break;&lt;br&gt;	}&lt;br&gt;	usleep(2500);&lt;br&gt;	flush();&lt;br&gt;}&lt;br&gt;?&amp;gt;&lt;br&gt;&lt;/code&gt;&lt;br&gt;&lt;br&gt;It doesn't work in I.E&lt;br&gt;&lt;br&gt;Thanks again matt&lt;br&gt;&lt;/code&gt;&lt;/code&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">imwoodie</dc:creator><pubDate>Sat, 12 Sep 2009 13:02:26 -0000</pubDate></item><item><title>Re: PHP jQuery AJAX Javascript Long Polling</title><link>http://www.perplexedlabs.com/2009/05/04/php-jquery-ajax-javascript-long-polling/#comment-16294037</link><description>&lt;p&gt;Hi, I'm using jquery-1.3.2.. I try to implement your code and is running well in FF, safari, and opera. but it doesn't work in IE.. would you like to give me a clue.. thank you&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">imwoodie</dc:creator><pubDate>Thu, 10 Sep 2009 03:37:59 -0000</pubDate></item></channel></rss>