자바스크립트로 현재 URL을 가져오려면 window.location.을 사용하세요. 참조 속성 -
예시
라이브 데모
<!DOCTYPE html>
<html>
<body>
<h3>Get current URL</h3>
<p id="test"></p>
<script>
document.getElementById("test").innerHTML = "URL of the page: " + window.location.href;
</script>
</body>
</html>