CCTI XML 문서 보기: 두 판 사이의 차이

Classics Wiki
새 문서: <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: 8px 15px; cursor: pointer; background-color: #007bff; color: white; border: none; border-radius: 4px; }
         button { padding: 10px; cursor: pointer; background-color: #28a745; color: white; border: none; border-radius: 4px; font-weight: bold; }
         button:hover { background-color: #0056b3; }
         button:hover { background-color: #218838; }
        label { font-size: 14px; color: #666; margin-bottom: -5px; }
     </style>
     </style>
</head>
</head>
<body>
<body>


     <h2>ID 입력 후 이동</h2>
     <h2>텍스트 유닛의 XML 문서 보기</h2>
   
     <div class="container">
     <div class="container">
         <input type="text" id="userId" placeholder="ID를 입력하세요" onkeypress="if(event.keyCode==13) redirectToUrl()">
        <label>Project 입력</label>
         <button onclick="redirectToUrl()">이동하기</button>
        <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 idValue = document.getElementById('userId').value;
             const id = document.getElementById('userId').value.trim();


             if (idValue.trim() === "") {
             if (!project || !id) {
                 alert("ID를 입력해주세요.");
                 alert("프로젝트와 ID를 모두 입력해주세요.");
                 return;
                 return;
             }
             }


             // 2. 입력받은 id 값을 가지고 지정된 URL로 redirect
             // 1. 기본 URL 설정
             const targetUrl = `http://app.vaquitalab.com/viewxml?id=${idValue}`;
             const baseUrl = "https://kstoryhub.visualasia.com/aistory/ccti_retrieve";
             window.location.href = targetUrl;
 
            // 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 기준 최신판

ID 리다이렉트

텍스트 유닛의 XML 문서 보기