Spaces:
test-sj-crm
/
Runtime error

DmitrMakeev commited on
Commit
ff18898
·
verified ·
1 Parent(s): 7a01815

Update biz_v.html

Browse files
Files changed (1) hide show
  1. biz_v.html +21 -1
biz_v.html CHANGED
@@ -48,7 +48,7 @@
48
  border: 1px solid #ccc;
49
  border-radius: 5px;
50
  }
51
- #responseArea {
52
  width: 80%;
53
  margin: 20px auto;
54
  padding: 10px;
@@ -80,6 +80,8 @@
80
  <button id="sendRequestButton">Send Request</button>
81
  <textarea id="responseArea" rows="10" cols="50" readonly></textarea>
82
  <div id="dropdown-container"></div>
 
 
83
 
84
  <script>
85
  document.getElementById('sendRequestButton').addEventListener('click', function() {
@@ -118,6 +120,24 @@
118
  select.appendChild(option);
119
  });
120
  container.appendChild(select);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  }
122
  </script>
123
  </body>
 
48
  border: 1px solid #ccc;
49
  border-radius: 5px;
50
  }
51
+ #responseArea, #secondResponseArea {
52
  width: 80%;
53
  margin: 20px auto;
54
  padding: 10px;
 
80
  <button id="sendRequestButton">Send Request</button>
81
  <textarea id="responseArea" rows="10" cols="50" readonly></textarea>
82
  <div id="dropdown-container"></div>
83
+ <button id="sendGetRequestButton">Send GET Request</button>
84
+ <textarea id="secondResponseArea" rows="10" cols="50" readonly></textarea>
85
 
86
  <script>
87
  document.getElementById('sendRequestButton').addEventListener('click', function() {
 
120
  select.appendChild(option);
121
  });
122
  container.appendChild(select);
123
+ // Добавление обработчика для кнопки отправки GET-запроса
124
+ document.getElementById('sendGetRequestButton').addEventListener('click', function() {
125
+ const selectedValue = document.getElementById('dropdown').value;
126
+ const token = document.getElementById('tokenInput').value;
127
+ const getUrl = '/send_get_request?token=' + encodeURIComponent(token) + '&webinarId=' + encodeURIComponent(selectedValue);
128
+ fetch(getUrl, {
129
+ method: 'GET'
130
+ })
131
+ .then(response => response.json())
132
+ .then(data => {
133
+ console.log('GET Response:', data);
134
+ document.getElementById('secondResponseArea').value = JSON.stringify(data, null, 2);
135
+ })
136
+ .catch(error => {
137
+ console.error('Error:', error);
138
+ document.getElementById('secondResponseArea').value = 'Error: ' + error.message;
139
+ });
140
+ });
141
  }
142
  </script>
143
  </body>