manyo 發表於 2024-8-17 02:22:09

COMICA

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>產生內嵌 HTML 代碼</title>
    <style>
      .form-container {
            max-width: 600px;
            margin: auto;
            padding: 20px;
            border: 1px solid #ccc;
            border-radius: 5px;
      }
      .form-container input,
      .form-container button {
            width: 100%;
            padding: 10px;
            margin: 5px 0 20px 0;
            border-radius: 5px;
            border: 1px solid #ddd;
            box-sizing: border-box;
      }
      .form-container button {
            background-color: #4CAF50;
            color: white;
            border: none;
            cursor: pointer;
      }
      .form-container button:hover {
            background-color: #45a049;
      }
      .output {
            background-color: #f1f1f1;
            padding: 10px;
            border: 1px solid #ccc;
            border-radius: 5px;
            white-space: pre-wrap; /* Preserve whitespace */
      }
    </style>
</head>
<body>

<div class="form-container">
    <h2>生成內嵌 HTML 代碼</h2>
    <input type="text" id="post-id" placeholder="輸入文章編號">
    <button onclick="generateEmbedCode()">生成 HTML</button>
    <div class="output" id="embed-code"></div>
</div>

<script>
    async function generateEmbedCode() {
      const postId = document.getElementById('post-id').value;

      if (!postId) {
            alert('請輸入文章編號');
            return;
      }

      try {
            // 假設文章的 URL 是這樣的
            const articleUrl = `https://komica1.org/thread-${postId}.html`;

            // 生成內嵌的 HTML 代碼
            const embedCode = `<iframe src="${articleUrl}" width="100%" height="600" frameborder="0"></iframe>`;

            // 顯示生成的 HTML 代碼
            document.getElementById('embed-code').textContent = embedCode;
      } catch (error) {
            console.error('生成內嵌代碼失敗', error);
            alert('生成內嵌代碼失敗,請檢查控制台錯誤信息。');
      }
    }
</script>

</body>
</html>
頁: [1]
查看完整版本: COMICA

一粒米 | 中興米 | 論壇美工 | 設計 抗ddos | 天堂私服 | ddos | ddos | 防ddos | 防禦ddos | 防ddos主機 | 天堂美工 | 設計 防ddos主機 | 抗ddos主機 | 抗ddos | 抗ddos主機 | 抗攻擊論壇 | 天堂自動贊助 | 免費論壇 | 天堂私服 | 天堂123 | 台南清潔 | 天堂 | 天堂私服 | 免費論壇申請 | 抗ddos | 虛擬主機 | 實體主機 | vps | 網域註冊 | 抗攻擊遊戲主機 | ddos |