편집 요약 없음 |
편집 요약 없음 |
||
(같은 사용자의 중간 판 하나는 보이지 않습니다) | |||
16번째 줄: | 16번째 줄: | ||
const timestamp = `${y}${m}${d}${h}${min}`; | const timestamp = `${y}${m}${d}${h}${min}`; | ||
const page = `연습장:${username}/${timestamp}`; | const page = `연습장:${username}/${timestamp}`; | ||
const | const url = new URL("/wiki/index.php", location.origin); | ||
url.searchParams.set("title", page); | |||
url.searchParams.set("action", "edit"); | |||
const a = document.createElement("a"); | const a = document.createElement("a"); | ||
a.href | a.setAttribute("href", url.href); // ← 브라우저가 알아서 제대로 처리 | ||
a.className = "mw-ui-button"; | a.className = "mw-ui-button"; | ||
a.textContent = `연습장(${timestamp}) 만들기`; | a.textContent = `연습장(${timestamp}) 만들기`; | ||
document.getElementById("sandbox-button").appendChild(a); | const container = document.getElementById("sandbox-button"); | ||
container.innerHTML = ""; | |||
container.appendChild(a); | |||
}); | }); | ||
</script> | </script> | ||
</html> | </html> |
2025년 4월 9일 (수) 14:29 기준 최신판