- 아래 링크로
- project는 각자 학번 / pagename
<html lang="ko">
<head>
<meta charset="UTF-8">
<title>ID 리다이렉트</title>
<style>
body { font-family: sans-serif; padding: 20px; }
.container { display: flex; gap: 10px; }
input { padding: 8px; border: 1px solid #ccc; border-radius: 4px; }
button { padding: 8px 15px; cursor: pointer; background-color: #007bff; color: white; border: none; border-radius: 4px; }
button:hover { background-color: #0056b3; }
</style>
</head>
<body>
<h2>ID 입력 후 이동</h2>
<div class="container">
<input type="text" id="userId" placeholder="ID를 입력하세요" onkeypress="if(event.keyCode==13) redirectToUrl()">
<button onclick="redirectToUrl()">이동하기</button>
</div>
<script>
function redirectToUrl() {
// 입력창의 값을 가져옵니다.
const idValue = document.getElementById('userId').value;
if (idValue.trim() === "") {
alert("ID를 입력해주세요.");
return;
}
// 2. 입력받은 id 값을 가지고 지정된 URL로 redirect
const targetUrl = `http://app.vaquitalab.com/viewxml?id=${idValue}`;
window.location.href = targetUrl;
}
</script>
</body>
</html>