Frontend/前端_基礎HTML/templates/Demo_next.html

60 lines
1.5 KiB
HTML
Raw Permalink Normal View History

2024-04-23 18:57:58 +08:00
<!DOCTYPE html>
<html lang="en">
<head>
<title>Flask HTML CSS Example</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename='lib/bootstrap/dist/css/bootstrap.min.css') }}"/>
<link rel="stylesheet" href="{{ url_for('static', filename='css/site.css') }}" asp-append-version="true"/>
<script src="{{ url_for('static', filename='js/script.js') }}"></script>
<script src="{{ url_for('static', filename='js/site.js') }}"></script>
<script src="{{ url_for('static', filename='lib/bootstrap/dist/js/bootstrap.bundle.min.js') }}"></script>
<script src="{{ url_for('static', filename='lib/jquery/dist/jquery.min.js') }}" asp-append-version="true"></script>
</head>
<body>
<h1>Flask</h1>
<div class="size2">
<div>
Hello World!
</div>
<input type="text" id="value_id" />
<button onclick="next_clicked()">下一頁</button>
<button onclick="get_data()">獲取資料</button>
</div>
</body>
</html>
<script>
function next_clicked(){
var id = document.getElementById("value_id").value
window.location = "/next/" + id;
}
function get_data(){
$.ajax({
type: "GET",
url: "/api/get_data",
data: {},
contentType: "application/json",
success: function (Model) {
console.log(Model)
//set_data(Model)
}
});
}
</script>