用免费云服务器,三丰云开发web程序
以下是一个使用 HTMX 和 PHP 实现将球队编号从后台返回并可修改,然后提交修改的简单示例:
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/htmx.org@1.9.5">
</script>
</head>
<body>
<input type="text" hx-get="get_team_number.php" hx-target="#team_number" id="team_number" />
<button hx-post="update_team_number.php" hx-vals='{"team_number": $("#team_number").val()}' hx-target="#result">提交修改</button>
<div id="result">
</div>
</body>
</html>