DmitrMakeev commited on
Commit
84e5ba3
1 Parent(s): 51366c5

Update biz_v.html

Browse files
Files changed (1) hide show
  1. biz_v.html +22 -45
biz_v.html CHANGED
@@ -1,4 +1,3 @@
1
- <!DOCTYPE html>
2
  <html lang="en">
3
  <head>
4
  <meta charset="UTF-8">
@@ -10,51 +9,29 @@
10
  <label for="tokenInput">Enter Token:</label>
11
  <input type="text" id="tokenInput" placeholder="Your Token">
12
  <button id="sendRequestButton">Send Request</button>
13
- <div id="responseArea"></div>
14
 
15
- <script>
16
- document.getElementById('sendRequestButton').addEventListener('click', function() {
17
- const token = document.getElementById('tokenInput').value;
18
- const url = '/send_request';
19
- fetch(url, {
20
- method: 'POST',
21
- headers: {
22
- 'Content-Type': 'application/x-www-form-urlencoded'
23
- },
24
- body: 'token=' + encodeURIComponent(token)
25
- })
26
- .then(response => response.json())
27
- .then(data => {
28
- console.log('JSON Response:', data); // Вывод JSON-ответа в консоль
29
- displayData(data);
30
- })
31
- .catch(error => {
32
- console.error('Error:', error);
33
- document.getElementById('responseArea').innerHTML = 'Error: ' + error.message;
34
- });
35
  });
36
-
37
- function displayData(data) {
38
- const responseArea = document.getElementById('responseArea');
39
- responseArea.innerHTML = ''; // Очищаем предыдущий контент
40
-
41
- if (data.list && data.list.length > 0) {
42
- data.list.forEach(item => {
43
- const webinarDiv = document.createElement('div');
44
- webinarDiv.innerHTML = `
45
- <h2>${item.name}</h2>
46
- <p>${item.text}</p>
47
- <p>Type: ${item.type}</p>
48
- <p>Participants: ${item.count1}</p>
49
- <p>Duration: ${item.count2} minutes</p>
50
- <p>Created: ${item.created}</p>
51
- `;
52
- responseArea.appendChild(webinarDiv);
53
- });
54
- } else {
55
- responseArea.innerHTML = 'No webinars found.';
56
- }
57
- }
58
- </script>
59
  </body>
60
  </html>
 
 
1
  <html lang="en">
2
  <head>
3
  <meta charset="UTF-8">
 
9
  <label for="tokenInput">Enter Token:</label>
10
  <input type="text" id="tokenInput" placeholder="Your Token">
11
  <button id="sendRequestButton">Send Request</button>
12
+ <textarea id="responseArea" rows="10" cols="50" readonly></textarea>
13
 
14
+ <script>
15
+ document.getElementById('sendRequestButton').addEventListener('click', function() {
16
+ const token = document.getElementById('tokenInput').value;
17
+ const url = '/send_request';
18
+ fetch(url, {
19
+ method: 'POST',
20
+ headers: {
21
+ 'Content-Type': 'application/x-www-form-urlencoded'
22
+ },
23
+ body: 'token=' + encodeURIComponent(token)
24
+ })
25
+ .then(response => response.json())
26
+ .then(data => {
27
+ console.log('JSON Response:', data); // Вывод JSON-ответа в консоль
28
+ document.getElementById('responseArea').value = JSON.stringify(data, null, 2);
29
+ })
30
+ .catch(error => {
31
+ console.error('Error:', error);
32
+ document.getElementById('responseArea').value = 'Error: ' + error.message;
 
33
  });
34
+ });
35
+ </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  </body>
37
  </html>