KikiQiQi commited on
Commit
df97a6b
·
1 Parent(s): 641b7b8

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +41 -17
index.html CHANGED
@@ -1,19 +1,43 @@
1
  <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  </html>
 
1
  <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>选择对话框页面</title>
7
+ </head>
8
+ <body>
9
+
10
+ <label for="dialogueSelector">选择对话框:</label>
11
+ <select id="dialogueSelector" onchange="loadDialogue()">
12
+ <option value="output.html">对话框 1</option>
13
+ <!-- <option value="dialogue-2.html">对话框 2</option> -->
14
+ <!-- 添加更多选项,对应不同的对话框页面 -->
15
+ </select>
16
+
17
+ <div id="dialogueContainer">
18
+ <!-- 这里将显示选定的对话框页面的内容 -->
19
+ </div>
20
+
21
+ <script>
22
+ function loadDialogue() {
23
+ var selectElement = document.getElementById('dialogueSelector');
24
+ var selectedValue = selectElement.value;
25
+
26
+ var dialogueContainer = document.getElementById('dialogueContainer');
27
+
28
+ // 使用Fetch API异步加载选定的对话框页面
29
+ fetch(selectedValue)
30
+ .then(response => response.text())
31
+ .then(data => {
32
+ // 将页面内容设置为对话框容器的innerHTML
33
+ dialogueContainer.innerHTML = data;
34
+ })
35
+ .catch(error => console.error('Error loading dialogue:', error));
36
+ }
37
+
38
+ // 页面加载时默认加载第一个对话框页面
39
+ loadDialogue();
40
+ </script>
41
+
42
+ </body>
43
  </html>