How to use JavaScript to get the current URL
- Forrige side Få nuværende dato
- Næste side Få nuværende skærmstørrelse
Learn how to use JavaScript to get the current URL.
Current URL
Use window.location.href
Get the current URL address:
Example
document.getElementById("demo").innerHTML = "The full URL of this page is:<br>" + window.location.href;
Related pages
Reference manual:JavaScript window.location objekt
- Forrige side Få nuværende dato
- Næste side Få nuværende skærmstørrelse