Spaces:
Runtime error
Runtime error
Create index.html
Browse files- index.html +37 -0
index.html
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<title>Stock Data Fetching</title>
|
| 6 |
+
<script>
|
| 7 |
+
function fetchData() {
|
| 8 |
+
fetch('/fetch-stock-data') // Route to fetch stock data
|
| 9 |
+
.then(response => response.json())
|
| 10 |
+
.then(data => {
|
| 11 |
+
// Process the fetched data (display or use as needed)
|
| 12 |
+
console.log(data);
|
| 13 |
+
});
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
function showProgress() {
|
| 17 |
+
document.getElementById('progress').style.display = 'block';
|
| 18 |
+
fetchData(); // Call the function to fetch data
|
| 19 |
+
}
|
| 20 |
+
</script>
|
| 21 |
+
<style>
|
| 22 |
+
#progress {
|
| 23 |
+
display: none;
|
| 24 |
+
text-align: center;
|
| 25 |
+
margin-top: 50px;
|
| 26 |
+
}
|
| 27 |
+
</style>
|
| 28 |
+
</head>
|
| 29 |
+
<body>
|
| 30 |
+
<h1>Stock Data Fetching</h1>
|
| 31 |
+
<button onclick="showProgress()">Fetch Stock Data</button>
|
| 32 |
+
<div id="progress">
|
| 33 |
+
<p>Fetching stock data...</p>
|
| 34 |
+
<progress value="0" max="100"></progress>
|
| 35 |
+
</div>
|
| 36 |
+
</body>
|
| 37 |
+
</html>
|