CCTI XML 문서 보기: 두 판 사이의 차이
새 문서: <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> </hea... |
편집 요약 없음 |
||
| (같은 사용자의 중간 판 5개는 보이지 않습니다) | |||
| 5번째 줄: | 5번째 줄: | ||
<style> | <style> | ||
body { font-family: sans-serif; padding: 20px; } | body { font-family: sans-serif; padding: 20px; } | ||
.container { display: flex; gap: 10px; } | .container { display: flex; flex-direction: column; gap: 10px; max-width: 350px; } | ||
input { padding: 8px; border: 1px solid #ccc; border-radius: 4px; } | input { padding: 8px; border: 1px solid #ccc; border-radius: 4px; } | ||
button { padding: | button { padding: 10px; cursor: pointer; background-color: #28a745; color: white; border: none; border-radius: 4px; font-weight: bold; } | ||
button:hover { background-color: # | button:hover { background-color: #218838; } | ||
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"> | ||
<input type="text" id="userId" placeholder=" | <label>Project 입력</label> | ||
<button onclick="redirectToUrl()"> | <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> | |||
</div> | </div> | ||
<script> | <script> | ||
function redirectToUrl() { | function redirectToUrl() { | ||
const project = document.getElementById('projectInput').value.trim(); | |||
const | const id = document.getElementById('userId').value.trim(); | ||
if ( | if (!project || !id) { | ||
alert("ID를 입력해주세요."); | alert("프로젝트와 ID를 모두 입력해주세요."); | ||
return; | return; | ||
} | } | ||
// | // 1. 기본 URL 설정 | ||
const | const baseUrl = "https://kstoryhub.visualasia.com/aistory/ccti_retrieve"; | ||
window. | |||
// 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 기준 최신판