CCTI XML 문서 보기: 두 판 사이의 차이
편집 요약 없음 |
편집 요약 없음 |
||
| (같은 사용자의 중간 판 4개는 보이지 않습니다) | |||
| 1번째 줄: | 1번째 줄: | ||
<html lang="ko"> | <html lang="ko"> | ||
<head> | <head> | ||
<meta charset="UTF-8"> | <meta charset="UTF-8"> | ||
<title>ID | <title>ID 리다이렉트</title> | ||
<style> | <style> | ||
body { font-family: sans-serif; padding: 20px | body { font-family: sans-serif; padding: 20px; } | ||
.container { display: flex; flex-direction: column; gap: 10px; max-width: | .container { display: flex; flex-direction: column; gap: 10px; max-width: 350px; } | ||
input { padding: 8px; border: 1px solid #ccc; border-radius: 4px; } | |||
button { padding: 10px; cursor: pointer; background-color: #28a745; color: white; border: none; border-radius: 4px; font-weight: bold; } | |||
input { padding: | button:hover { background-color: #218838; } | ||
button { | label { font-size: 14px; color: #666; margin-bottom: -5px; } | ||
</style> | </style> | ||
</head> | </head> | ||
<body> | <body> | ||
<h2> | <h2>텍스트 유닛의 XML 문서 보기</h2> | ||
<div class="container"> | <div class="container"> | ||
<label>Project 입력</label> | |||
<input type="text" id="projectInput" placeholder="예: s2601056"> | |||
<label>텍스트 유닛 ID 입력</label> | |||
<input type="text" id="userId" placeholder="예: 논어-01-01" | |||
onkeypress="if(event.keyCode==13) redirectToUrl()"> | |||
<button onclick="redirectToUrl()">조회하기</button> | |||
<button onclick="redirectToUrl()"> | |||
</div> | </div> | ||
<script> | <script> | ||
function redirectToUrl() { | function redirectToUrl() { | ||
const project = document.getElementById('projectInput').value.trim(); | |||
const | const id = document.getElementById('userId').value.trim(); | ||
const | |||
if (!project || !id) { | |||
if ( | |||
alert("프로젝트와 ID를 모두 입력해주세요."); | alert("프로젝트와 ID를 모두 입력해주세요."); | ||
return; | return; | ||
} | } | ||
// | // 1. 기본 URL 설정 | ||
const baseUrl = "https://kstoryhub.visualasia.com/aistory/ccti_retrieve"; | const baseUrl = "https://kstoryhub.visualasia.com/aistory/ccti_retrieve"; | ||
// | // 2. 파라미터 구성 (객체 형태) | ||
// 브라우저가 & 기호를 자동으로 적절하게 처리하도록 합니다. | |||
const params = new URLSearchParams({ | |||
server: "kstorydata.visualasia.com", | |||
db: "aiclassics2601", | |||
project: project, | |||
id: id | |||
}); | |||
// 3. 최종 URL 생성 (toString()을 쓰면 & 기호가 깨지지 않고 연결됩니다) | |||
const finalUrl = baseUrl + "?" + params.toString(); | |||
// 확인을 위해 콘솔에 출력 (F12 누르면 볼 수 있습니다) | |||
console.log("이동 URL:", finalUrl); | |||
// 이동 | |||
window.open(finalUrl, '_blank'); | |||
} | } | ||
</script> | </script> | ||
2026년 4월 27일 (월) 00:42 기준 최신판