Professional Documents
Culture Documents
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Spreads</title>
<style>
body {
font-family: Arial, sans-serif;
}
.button-container {
display: flex;
justify-content: center;
margin-bottom: 20px;
}
.button {
border: none;
background-color: #f0f0f0;
padding: 10px 20px;
cursor: pointer;
font-size: 16px;
margin-right: 10px;
}
.button.active {
background-color: #ccc;
}
.content {
display: none;
}
.content.active {
display: block;
}
table {
width: 100%;
border-collapse: collapse;
}
th, td {
border: 1px solid #ddd;
padding: 8px;
text-align: left;
}
th {
background-color: #f2f2f2;
font-weight: bold;
}
</style>
</head>
<body>
<div class="button-container">
<button class="button active" id="fxBtn" onclick="changeContent('fx')">FX
Spreads</button>
<button class="button" id="kriptoBtn"
onclick="changeContent('kripto')">Crypto Spreads</button>
</div>
<script>
function changeContent(contentId) {
const contentElements = document.querySelectorAll(".content");
const buttonElements = document.querySelectorAll(".button");
contentElements.forEach(content => content
.classList.remove("active"));
buttonElements.forEach(button => button.classList.remove("active"));
document.getElementById(contentId).classList.add("active");
if (contentId === "fx") {
document.getElementById("fxBtn").classList.add("active");
} else if (contentId === "kripto") {
document.getElementById("kriptoBtn").classList.add("active");
}
}
} catch (error) {
console.error(error);
}
}
getSpreadData(pairSelect.value
// Verileri belirli aralıklarla güncelle
setInterval(() => {
getSpreadData(pairSelect.value);
}, 3000); // 3 saniye