setInterval(function() { $.ajax({ type: "POST", url: "mnemo_1.php", data: "func=1", success: function(res){alert(res);}, error: function(){alert('Problem');} }); }, 3000);