test/date.html

25 lines
745 B
HTML
Raw Normal View History

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>选择日期</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</head>
<body>
<h3>你选择的日期为:</h3>
<div id="selectedDate">No date selected</div>
<script>
$(document).ready(function() {
var urlParams = new URLSearchParams(window.location.search);
var dateString = urlParams.get('date');
if (dateString) {
$('#selectedDate').text(dateString);
} else {
console.warn('No date found in the URL.');
}
});
</script>
</body>
</html>