<?php
if (isset($_REQUEST['action'])) {
if ($_REQUEST['action'] == 'ajax') {
sleep(60);
echo 'ok';
exit;
}
}
?>
<html>
<head>
<script type="text/javascript" src="/jscript/jquery/jquery-1.9.1.min.js"></script>
</head>
<body>
<script>
function buttonOnClick()
{
$('#console').html('Started');
$.ajax({
url: "/tmp/test.php",
dataType : "html",
type: "POST",
data: "action=ajax",
success: function(msg) {
$('#console').html('Ok');
}
});
}
</script>
<input type="button" name="start" value="Start" onclick="buttonOnClick();">
<div id="console"></div>
<?php
for ($i=0; $i < 100; $i++) {
echo '<br> String ', $i;
}
?>
</body>
</html>