Update biz_v.html
Browse files- biz_v.html +20 -2
biz_v.html
CHANGED
|
@@ -20,7 +20,7 @@
|
|
| 20 |
font-size: 28px;
|
| 21 |
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
|
| 22 |
}
|
| 23 |
-
button
|
| 24 |
display: block;
|
| 25 |
margin: 20px auto;
|
| 26 |
color: white;
|
|
@@ -32,7 +32,7 @@
|
|
| 32 |
border-radius: 5px;
|
| 33 |
transition: background-color 0.3s ease;
|
| 34 |
}
|
| 35 |
-
button
|
| 36 |
background-color: #388E3C;
|
| 37 |
}
|
| 38 |
</style>
|
|
@@ -44,6 +44,7 @@
|
|
| 44 |
<button id="sendRequestButton">Send Request</button>
|
| 45 |
<textarea id="responseArea" rows="10" cols="50" readonly></textarea>
|
| 46 |
<div id="dropdown-container"></div>
|
|
|
|
| 47 |
|
| 48 |
<script>
|
| 49 |
document.getElementById('sendRequestButton').addEventListener('click', function() {
|
|
@@ -73,6 +74,7 @@
|
|
| 73 |
function createDropdown(data) {
|
| 74 |
const container = document.getElementById('dropdown-container');
|
| 75 |
const select = document.createElement('select');
|
|
|
|
| 76 |
|
| 77 |
data.forEach(item => {
|
| 78 |
const option = document.createElement('option');
|
|
@@ -82,6 +84,22 @@
|
|
| 82 |
});
|
| 83 |
|
| 84 |
container.appendChild(select);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
}
|
| 86 |
</script>
|
| 87 |
</body>
|
|
|
|
| 20 |
font-size: 28px;
|
| 21 |
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
|
| 22 |
}
|
| 23 |
+
button {
|
| 24 |
display: block;
|
| 25 |
margin: 20px auto;
|
| 26 |
color: white;
|
|
|
|
| 32 |
border-radius: 5px;
|
| 33 |
transition: background-color 0.3s ease;
|
| 34 |
}
|
| 35 |
+
button:hover {
|
| 36 |
background-color: #388E3C;
|
| 37 |
}
|
| 38 |
</style>
|
|
|
|
| 44 |
<button id="sendRequestButton">Send Request</button>
|
| 45 |
<textarea id="responseArea" rows="10" cols="50" readonly></textarea>
|
| 46 |
<div id="dropdown-container"></div>
|
| 47 |
+
<button id="sendGetRequestButton">Send GET Request</button>
|
| 48 |
|
| 49 |
<script>
|
| 50 |
document.getElementById('sendRequestButton').addEventListener('click', function() {
|
|
|
|
| 74 |
function createDropdown(data) {
|
| 75 |
const container = document.getElementById('dropdown-container');
|
| 76 |
const select = document.createElement('select');
|
| 77 |
+
select.id = 'dropdown';
|
| 78 |
|
| 79 |
data.forEach(item => {
|
| 80 |
const option = document.createElement('option');
|
|
|
|
| 84 |
});
|
| 85 |
|
| 86 |
container.appendChild(select);
|
| 87 |
+
|
| 88 |
+
// Добавление обработчика для кнопки отправки GET-запроса
|
| 89 |
+
document.getElementById('sendGetRequestButton').addEventListener('click', function() {
|
| 90 |
+
const selectedValue = document.getElementById('dropdown').value;
|
| 91 |
+
const getUrl = 'https://example.com?selectedValue=' + encodeURIComponent(selectedValue);
|
| 92 |
+
fetch(getUrl, {
|
| 93 |
+
method: 'GET'
|
| 94 |
+
})
|
| 95 |
+
.then(response => response.json())
|
| 96 |
+
.then(data => {
|
| 97 |
+
console.log('GET Response:', data);
|
| 98 |
+
})
|
| 99 |
+
.catch(error => {
|
| 100 |
+
console.error('Error:', error);
|
| 101 |
+
});
|
| 102 |
+
});
|
| 103 |
}
|
| 104 |
</script>
|
| 105 |
</body>
|