사용자:강혜원: 두 판 사이의 차이
문서를 비움 태그: 비우기 |
편집 요약 없음 |
||
| 1번째 줄: | 1번째 줄: | ||
<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> | |||
2026년 4월 23일 (목) 03:28 판