- 
                    Üyelik
                    14.01.2018
                
- 
                    Yaş/Cinsiyet
                    53 / E
                
- 
                    Meslek
                    Programcı
                
- 
                    Konum
                    İzmir
                
                - 
                    Ad Soyad
                    S** S**
                
- 
                    Mesajlar
                    319
                
- 
                    Beğeniler
                    4 / 111
                
- 
                    Ticaret
                    0, (%0)
                
 
                
js
setTimeout(function run() {
  $.get( "example.php")
  .done(function(response) {
	if(response.prototype.hasOwnProperty("state")) {
		if(response.state("ok")) {
			$("#update_edilecek_div_id").html(response.html);
		} else {
			console.info(response.msg);
		}
	}
  })
  .fail(function() {
    console.error("falanyum arızasından dolayısı ile şutingen oldu...");
  })
  .always(function() {
    setTimeout(run, 30000);
  });
  
}, 30000);
example.php
if($hede = "hodo") {
	$response['state'] = "ok";
	$response['html'] = "div şeysinin içi";
} else {
	$response['state'] = "nok";
	$response['msg'] = "Makina soğuk abi marş basmıyo";
}
echo json_encode($response);
// bu sayfada başka hiç bir echo çıktıcı noka virgül session şeysi, bilmem ne hatası olmayacak.