Created
April 16, 2021 14:27
-
-
Save Ginnw2/cdd7679a2536ffead6e1d00ee141a905 to your computer and use it in GitHub Desktop.
Пошаговая работа скрипта.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="loader">Loade...</div> | |
<div class="step"></div> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script> | |
<script type="text/javascript"> | |
function func(i) | |
{ | |
var form_data = new FormData(); | |
form_data.append('ITER', i); | |
$.ajax({ | |
type: "POST", | |
async: true, | |
url: '/hlCoordinateSetter.php', | |
cache: false, | |
contentType: false, | |
processData: false, | |
data: form_data, | |
beforeSend: function() { | |
$('.loader').show(); | |
}, | |
success: function(result) { | |
console.log(result); | |
$('.step').html(result); | |
var nextstep = parseInt(result)+1; | |
setTimeout(func, 5000, nextstep); | |
}, | |
error: function(error) { | |
alert('error; ' + eval(error)); | |
}, | |
complete: function() { | |
$('.loader').hide(); | |
} | |
}); | |
} | |
var i = 1; | |
setTimeout(func, 300, i); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment