Update biz_v.html
Browse files- biz_v.html +5 -1
biz_v.html
CHANGED
|
@@ -45,6 +45,7 @@
|
|
| 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() {
|
|
@@ -88,16 +89,19 @@
|
|
| 88 |
// Добавление обработчика для кнопки отправки GET-запроса
|
| 89 |
document.getElementById('sendGetRequestButton').addEventListener('click', function() {
|
| 90 |
const selectedValue = document.getElementById('dropdown').value;
|
| 91 |
-
const
|
|
|
|
| 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 |
}
|
|
|
|
| 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 |
+
<textarea id="secondResponseArea" rows="10" cols="50" readonly></textarea>
|
| 49 |
|
| 50 |
<script>
|
| 51 |
document.getElementById('sendRequestButton').addEventListener('click', function() {
|
|
|
|
| 89 |
// Добавление обработчика для кнопки отправки GET-запроса
|
| 90 |
document.getElementById('sendGetRequestButton').addEventListener('click', function() {
|
| 91 |
const selectedValue = document.getElementById('dropdown').value;
|
| 92 |
+
const token = document.getElementById('tokenInput').value;
|
| 93 |
+
const getUrl = '/send_get_request?token=' + encodeURIComponent(token) + '&selectedValue=' + encodeURIComponent(selectedValue);
|
| 94 |
fetch(getUrl, {
|
| 95 |
method: 'GET'
|
| 96 |
})
|
| 97 |
.then(response => response.json())
|
| 98 |
.then(data => {
|
| 99 |
console.log('GET Response:', data);
|
| 100 |
+
document.getElementById('secondResponseArea').value = JSON.stringify(data, null, 2);
|
| 101 |
})
|
| 102 |
.catch(error => {
|
| 103 |
console.error('Error:', error);
|
| 104 |
+
document.getElementById('secondResponseArea').value = 'Error: ' + error.message;
|
| 105 |
});
|
| 106 |
});
|
| 107 |
}
|