File size: 1,143 Bytes
36bd0e2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<html>
<head>
    <title>Ticker Checker</title>
    <style>
        body { font-family: Arial; margin: 40px; }
        input { padding: 8px; width: 200px; }
        button { padding: 8px 12px; }
        #result { margin-top: 20px; font-size: 18px; }
    </style>
</head>
<body>

<h2>Check if a Ticker Exists</h2>

<input id="tickerInput" type="text" placeholder="Enter ticker (e.g., AAPL)">
<button onclick="checkTicker()">Check</button>

<div id="result"></div>

<script>
async function checkTicker() {
    const ticker = document.getElementById("tickerInput").value.trim().toUpperCase();
    const resultDiv = document.getElementById("result");

    if (!ticker) {
        resultDiv.innerHTML = "Please enter a ticker.";
        return;
    }

    const response = await fetch(`/check/${ticker}`);
    const data = await response.json();

    if (data.exists) {
        resultDiv.innerHTML = `<span style="color: green;">✔ ${ticker} exists in the dataset</span>`;
    } else {
        resultDiv.innerHTML = `<span style="color: red;">✘ ${ticker} does NOT exist in the dataset</span>`;
    }
}
</script>

</body>
</html>