Skip to content

Commit 56ee451

Browse files
committed
added 3 second delay after download images ahs started then page refresh
1 parent c6a6787 commit 56ee451

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

templates/home.html

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,22 @@ <h1>WebGSM</h1>
2828
<p id="download-status"></p>
2929
</div>
3030

31-
<script>
32-
// When the download button is clicked
33-
$('#download-button').click(function() {
34-
// Send an AJAX request to start the download process
35-
$.get('/start-download', function(data) {
36-
$('#download-status').text(data.message);
37-
}).fail(function(error) {
38-
$('#download-status').text("Error starting the download.");
31+
<script>
32+
// When the download button is clicked
33+
$('#download-button').click(function() {
34+
// Send an AJAX request to start the download process
35+
$.get('/start-download', function(data) {
36+
$('#download-status').text(data.message);
37+
38+
// Add a 3-second delay before refreshing the page
39+
setTimeout(function() {
40+
location.reload(); // Refresh the page
41+
}, 3000); // 3000 milliseconds = 3 seconds
42+
}).fail(function(error) {
43+
$('#download-status').text("Error starting the download.");
44+
});
3945
});
40-
});
41-
</script>
46+
</script>
47+
4248
</body>
4349
</html>

0 commit comments

Comments
 (0)