You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
973 B
33 lines
973 B
6 months ago
|
<!DOCTYPE html>
|
||
|
<html>
|
||
|
<head>
|
||
|
<title>家居管理</title>
|
||
|
<script>
|
||
|
function openWindow(message) {
|
||
|
var win = window.open("", "家居操作结果", "width=400,height=200");
|
||
|
win.document.write("<p>" + message + "</p>");
|
||
|
}
|
||
|
</script>
|
||
|
</head>
|
||
|
<body>
|
||
|
<!-- 你的表单或其他交互元素 -->
|
||
|
<form id="jiaju-form">
|
||
|
<!-- 表单字段... -->
|
||
|
<button type="submit" onclick="sendRequest()">提交</button>
|
||
|
</form>
|
||
|
|
||
|
<script>
|
||
|
function sendRequest() {
|
||
|
// 发送AJAX请求到后端
|
||
|
fetch('/add_jiaju', {
|
||
|
method: 'POST',
|
||
|
headers: {'Content-Type': 'application/json'},
|
||
|
body: JSON.stringify({ /* 你的JSON数据 */ })
|
||
|
}).then(response => response.json())
|
||
|
.then(data => openWindow(data.message))
|
||
|
.catch(error => console.error('Error:', error));
|
||
|
}
|
||
|
</script>
|
||
|
</body>
|
||
|
</html>
|