View Single Post
Old 12-14-2012, 02:25 PM   PM User | #2
devnull69
Senior Coder

 
Join Date: Dec 2010
Posts: 2,245
Thanks: 10
Thanked 531 Times in 525 Posts
devnull69 will become famous soon enough
First of all, you should not call done() from inside the setTimeout callback. You should only call it after the request started by updates() finished, i.e. in its success callback

Second: There must not be a semicolon after the closing bracket of the success callback
Code:
$(document).ready(updates);
 
function updates() {
 $.ajax({
     url:"http://wawhost.com/appProject/fetch.php",
     dataType: 'jsonp',
     success:function(data){
       $("ul").empty();
       $.each(data.result, function(){
	    $("ul").append("<li>Name: "+this['name']+
		"</li><li>Age: "+this['age']+
		"</li><li>Company: "+this['company']+
		"</li><br />");
       });
       setTimeout(updates, 200);
     }
 });
}
This might not be the only issue here, but it should give you a good start :-)
devnull69 is offline   Reply With Quote